Summary: | _NET_WM_ICON hint doesn't force using icon of 'most appropriate' size | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | dmitry cherepanov <hail> |
Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
dmitry cherepanov
2006-07-31 15:22:46 UTC
SVN commit 568223 by lunakl: Pick correctly the best icon size. Also make -1,-1 return the largest icon and not the first one (makes more sense and saying the first one is as good as saying a random one). BUG: 131590 M +10 -5 netwm.cpp M +1 -1 netwm.h --- trunk/KDE/kdelibs/kdecore/netwm.cpp #568222:568223 @@ -3438,14 +3438,19 @@ return result; } + // find the largest icon result = icons[0]; + for (int i = 1; i < icons.size(); i++) { + if( icons[i].size.width >= result.size.width && + icons[i].size.height >= result.size.height ) + result = icons[i]; + } + // return the largest icon if w and h are -1 + if (width == -1 && height == -1) return result; + // find the icon that's closest in size to w x h... - // return the first icon if w and h are -1 - if (width == height && height == -1) return result; - - int i; - for (i = 0; i < icons.size(); i++) { + for (int i = 0; i < icons.size(); i++) { if ((icons[i].size.width >= width && icons[i].size.width < result.size.width) && (icons[i].size.height >= height && --- trunk/KDE/kdelibs/kdecore/netwm.h #568222:568223 @@ -1188,7 +1188,7 @@ /** Returns an icon. If width and height are passed, the icon returned will be the closest it can find (the next biggest). If width and height are omitted, - then the first icon in the list is returned. + then the largest icon in the list is returned. @param width the preferred width for the icon, -1 to ignore |