Bug 355919 - Some app return a large tray icon image with wide transparent border and result in an almost invisible statusitem icon
Summary: Some app return a large tray icon image with wide transparent border and resu...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: XembedSNIProxy (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 356497 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-26 07:06 UTC by Cjacker
Modified: 2019-08-30 12:01 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch (2.43 KB, text/plain)
2015-11-26 07:07 UTC, Cjacker
Details
Updated patch (2.46 KB, patch)
2015-11-26 09:51 UTC, Cjacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cjacker 2015-11-26 07:06:45 UTC
Tested with 'workrave'.

xembedsniproxy get a tray icon image with size 200x200 and wide trasnparent border, the real 'workrave' icon is centered in this large Qimage and after set icon of statusitem, it's almost invisible.

Here is a patch to:
1, find the non-transparent rect of QImage.
2, copy it and draw it to a foursquare/transparent QImage.
3, set the new QImage as statusitem icon.

It may affect all tray's icon, since even normal/correct icon may have a minor 'transparent border', after this process, it will be zoomed in a little, but I think it is acceptable. 

Or

We can create a larger foursquare Qimage and leave minor transparent borders there when draw image on it.










Reproducible: Always
Comment 1 Cjacker 2015-11-26 07:07:14 UTC
Created attachment 95749 [details]
Patch
Comment 2 Cjacker 2015-11-26 09:51:23 UTC
Created attachment 95753 [details]
Updated patch
Comment 3 David Edmundson 2015-12-12 21:32:01 UTC
Thanks

Sorry it's taken me so long to see your patches. It's pretty poor on my side. 

http://git.reviewboard.kde.org is the better place for patches, they stay at the top of my TODO list better.

Code-wise your patches seem fine:
  - make findImageTransparentBounding const
  - fix typo in comment
  - +                painter.drawImage((ximage.width() - ximage.height())/2, 0, ximage); 
     should be height - width 

Though I don't like how potentially slow it's going to be if we have an icon in the tray animating at 60fps

We *should* be resizing the window when we get it (see line ~160). 
Before merging this, I'd like to see  why the resize hasn't worked. Are we just grabbing the image too early? Does the client change itself back?
Comment 4 David Edmundson 2015-12-12 21:36:35 UTC
*** Bug 356497 has been marked as a duplicate of this bug. ***
Comment 5 Fabian Henze 2016-04-04 22:58:00 UTC
any news here? I think I am seeing this bug with the gtk application "liferea".
Comment 6 Alexander Mentyu 2017-12-05 19:39:32 UTC
Workwave tray icons are ok

Liferea tray icon isn't displayed - possibly due to not installed some opt dependency
Comment 7 Konrad Materka 2019-08-30 12:01:14 UTC
Workrave is working fine. Probably it was fixed by other change and this patch is not needed anymore.

Alexander Mentyu, Liferea is working fine for me. Please fill separate bug report if you still experience problems with it.