Bug 330807

Summary: Icons in systray are ridiculously big after upgrading to workspace 4.11.6
Product: [Plasma] plasma4 Reporter: Eugene Shalygin <eugene.shalygin+bugzilla.kde>
Component: widget-systemtrayAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: ab4bd, afiestas, carasin.berlogue, david, henri.kaustinen, hotmusicfan, hrvoje.senjan, hynek, kde, melendro, mpyne, niels_ole, notmart, phobosk, r.maurizzi, rdieter, rolfpedersen, sgruener, thomas, vitalif, zmeyski, zmogas
Priority: NOR    
Version: 4.11.6   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: illustration
screenshot of small displaced systray icons
Icons are large again with 4.12.3

Description Eugene Shalygin 2014-02-05 17:13:52 UTC
After upgrade to plasma 4.11.6 most of the icons in systray are inproporionally big

Reproducible: Always
Comment 1 Eugene Shalygin 2014-02-05 17:19:10 UTC
Created attachment 85007 [details]
illustration

Screenshot is taken with Doomsday theme, but the problem appears with Air too
Comment 2 Eugene Shalygin 2014-02-06 08:46:42 UTC
This is caused by commit c4b22caae66c2af26276c4c842fde82e883f0af4, in particular by 

-    property int iconSize: Math.min(root_item.width, Math.min(root_item.height, JS.ICONS_SIZE))
+    property int iconSize: Math.min(root_item.width, Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 : theme.largeIconSize)) //Math.min(root_item.width, Math.min(root_item.height, JS.ICONS_SIZE))
Comment 3 Eugene Shalygin 2014-02-06 08:52:45 UTC
I have a screen with 120 DPI  (do not think that this is HDPI device) and such large icons are certainly ugly
Comment 4 Henri 2014-02-08 10:22:15 UTC
Exactly this happened to me when I upgraded KDE from 4.12.1 to 4.12.2 (using openSUSE 13.1).
Comment 5 zmeyski@gmail.com 2014-02-10 18:25:07 UTC
same thing here. This behaviour can't be enabled unconditionally on all displays. Can't it be made configurable? Im using a System Tray with 2 rows of icons, this change broke it completely.
Comment 6 Jekyll Wu 2014-02-11 01:27:24 UTC
(In reply to comment #2)
> This is caused by commit c4b22caae66c2af26276c4c842fde82e883f0af4, in
> particular by 
> 
> -    property int iconSize: Math.min(root_item.width,
> Math.min(root_item.height, JS.ICONS_SIZE))
> +    property int iconSize: Math.min(root_item.width,
> Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 :
> theme.largeIconSize)) //Math.min(root_item.width, Math.min(root_item.height,
> JS.ICONS_SIZE))

Add the author(s) into CC list.
Comment 7 Thomas Mitterfellner 2014-02-11 20:58:41 UTC
Created attachment 85104 [details]
screenshot of small displaced systray icons
Comment 8 Thomas Mitterfellner 2014-02-11 21:00:02 UTC
Strange: in my case, after the upgrade to 4.12.2 (openSUSE 13.1), some of the icons are small and aligned to the top of the systray, almost as if there were two rows in the systray, see attachment https://bugs.kde.org/attachment.cgi?id=85104 (but I wouldn't know where to set the systray to use two rows, nor can I remember have made any change to the systray).
Is this related or should I file a new bug?

Anyway, it doesn't look good (the icons for xchat and hp used to be about as large as the amarok icon) and I preferred the larger size (o;
Comment 9 Jekyll Wu 2014-02-18 01:36:53 UTC
*** Bug 331262 has been marked as a duplicate of this bug. ***
Comment 10 Michael Pyne 2014-02-19 03:53:37 UTC
(In reply to comment #8)
> Strange: in my case, after the upgrade to 4.12.2 (openSUSE 13.1), some of
> the icons are small and aligned to the top of the systray, almost as if
> there were two rows in the systray, see attachment
> https://bugs.kde.org/attachment.cgi?id=85104 (but I wouldn't know where to
> set the systray to use two rows, nor can I remember have made any change to
> the systray).
> Is this related or should I file a new bug?

It should be related; it happens because there is no "large" icon for hp-systray or xchat, so a smaller icon is used instead, which should probably be scaled up to match the other icon sizes.

Anyways, I fixed this locally with the following patch, have avoided committing since this code is not mine and there might be a better Hi-DPI fix coming in (?):

diff --git a/plasma/generic/applets/systemtray/package/contents/ui/main.qml b/plasma/generic/applets/systemtray/package/contents/ui/main.qml
index 209091b..840bd1b 100644
--- a/plasma/generic/applets/systemtray/package/contents/ui/main.qml
+++ b/plasma/generic/applets/systemtray/package/contents/ui/main.qml
@@ -34,7 +34,7 @@ Item {
     property int minimumWidth:  JS.MINIMUM_SIZE
     property int minimumHeight: JS.MINIMUM_SIZE
 
-    property int iconSize: Math.min(root_item.width, Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 : theme.largeIconSize)) //Math.min(root_item.width, Math.min(root_item.height, JS.ICONS_SIZE))
+    property int iconSize: Math.min(root_item.width, Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 : theme.smallMediumIconSize)) //Math.min(root_item.width, Math.min(root_item.height, JS.ICONS_SIZE))
 
     // Data Models
     property list<ListModel> models: [
Comment 11 Christoph Feck 2014-02-24 23:12:31 UTC
*** Bug 331451 has been marked as a duplicate of this bug. ***
Comment 12 Sebastian Gruener 2014-02-27 11:11:17 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > Strange: in my case, after the upgrade to 4.12.2 (openSUSE 13.1), some of
> > the icons are small and aligned to the top of the systray, almost as if
> > there were two rows in the systray, see attachment
> > https://bugs.kde.org/attachment.cgi?id=85104 (but I wouldn't know where to
> > set the systray to use two rows, nor can I remember have made any change to
> > the systray).
> > Is this related or should I file a new bug?
> 
> It should be related; it happens because there is no "large" icon for
> hp-systray or xchat, so a smaller icon is used instead, which should
> probably be scaled up to match the other icon sizes.
> 
> Anyways, I fixed this locally with the following patch, have avoided
> committing since this code is not mine and there might be a better Hi-DPI
> fix coming in (?):
> 
> diff --git a/plasma/generic/applets/systemtray/package/contents/ui/main.qml
> b/plasma/generic/applets/systemtray/package/contents/ui/main.qml
> index 209091b..840bd1b 100644
> --- a/plasma/generic/applets/systemtray/package/contents/ui/main.qml
> +++ b/plasma/generic/applets/systemtray/package/contents/ui/main.qml
> @@ -34,7 +34,7 @@ Item {
>      property int minimumWidth:  JS.MINIMUM_SIZE
>      property int minimumHeight: JS.MINIMUM_SIZE
>  
> -    property int iconSize: Math.min(root_item.width,
> Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 :
> theme.largeIconSize)) //Math.min(root_item.width, Math.min(root_item.height,
> JS.ICONS_SIZE))
> +    property int iconSize: Math.min(root_item.width,
> Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 :
> theme.smallMediumIconSize)) //Math.min(root_item.width,
> Math.min(root_item.height, JS.ICONS_SIZE))
>  
>      // Data Models
>      property list<ListModel> models: [

Hey, I'm affected by this bug too, (just upgraded to 4.12.2/4.11.6 Backports PPA for Kubuntu 13.10) 
the suggested patch fixes the problem for me, too. So Marco, if you would take a look a the code in question, this would be really awesome.

btw: my Laptop has 138 DPI.
And on a sitenote, don't know if that's helpful at all, but: at the Chakra forum someone notes, that this might have something to do with the font size.
http://chakra-project.org/bbs/viewtopic.php?pid=79610

Ohh, and last but not least, the bug doesn't affect a newly created user on my machine. So I guess some local config breaks your initial commit. This is also suggested in the Chakra-thread.
Comment 13 Jekyll Wu 2014-02-28 03:14:00 UTC
*** Bug 331584 has been marked as a duplicate of this bug. ***
Comment 14 Marco Martin 2014-02-28 15:37:31 UTC
the uncentered xembed icons should be fixed in master
Comment 15 carasin 2014-03-01 17:42:01 UTC
I have this issue too. That's my report at RHBZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1066621

I've localized the problem. The issue has appeared after I had applied Open Sans font for KDE UI.
Applying some fonts causes the tray corruption. But applying some other fonts do not (e.g. DejaVu or Liberation).
Comment 16 Eugene Shalygin 2014-03-05 21:45:22 UTC
Upgrade to 4.11.7 -> the same problem. 
BTW, I'm using DejaVu Sans font for desktop
Comment 17 Thomas Mitterfellner 2014-03-08 13:50:04 UTC
As for the small systray icons (hp, xchat) – those are large again after upgrading to KDE SC 4.12.3.
Comment 18 Thomas Mitterfellner 2014-03-08 13:51:43 UTC
Created attachment 85477 [details]
Icons are large again with 4.12.3
Comment 19 Eugene Shalygin 2014-04-04 06:44:49 UTC
Still exists in 4.11.8
Comment 20 Roberto Maurizzi 2014-04-23 07:56:08 UTC
I'm sorry to look like the usual ungrateful grumpy guy, but... any news? We have the code that explain why and how this happened and the bug report is still UNCONFIRMED?
It's still happening on the new Ubuntu 14.04 with KDE 4.13.0

First of all, the "fix" for people without HD displays is to set the default font size to less than 20. This explains why many users aren't seeing the problem at all.

But if you just bought a nice FullHD 16" laptop then you're WAY out of luck if you want to see the text on your monitor AND keep a "tall" panel and have many systray icons or if you like to have 2 lines of icons :-)
Comment 21 Melendro 2014-04-23 19:29:15 UTC
There's another workaround (I wouldn't call it a fix).
Edit the file /usr/share/kde4/apps/plasma/packages/org.kde.systemtray/contents/ui/main.qml and change the line:

property int iconSize: Math.min(root_item.width, Math.min(root_item.height, theme.defaultFont.mSize.height < 20 ? 24 : theme.largeIconSize)) //Math.min(root_item.width, Math.min(root_item.height, JS.ICONS_SIZE))

by the line:

property int iconSize: Math.min(root_item.width, Math.min(root_item.height, JS.ICONS_SIZE))

But only until next upgrade, as this file will be overwritten...
Comment 22 Henri 2014-04-29 19:08:18 UTC
*** This bug has been confirmed by popular vote. ***
Comment 23 Nate Graham 2018-06-08 18:38:27 UTC
Hello!

This bug report was filed for KDE Plasma 4, which reached end-of-support status in August 2015. KDE Plasma 5's desktop shell has been almost completely rewritten for better performance and usability, so it is likely that this bug has already been resolved in Plasma 5.

Accordingly, we hope you understand why we must close this bug report. If the issue described  here is still present in KDE Plasma 5.12 or later, please feel free to open a new ticket in the "plasmashell" product after reading https://community.kde.org/Get_Involved/Bug_Reporting

If you would like to get involved in KDE's bug triaging effort so that future mass bug closes like this are less likely, please read https://community.kde.org/Get_Involved#Bug_Triaging

Thanks for your understanding!

Nate Graham