Bug 358240 - KeePass2 system tray icon is shown as white square
Summary: KeePass2 system tray icon is shown as white square
Alias: None
Product: plasmashell
Classification: Plasma
Component: XembedSNIProxy (show other bugs)
Version: 5.5.3
Platform: Kubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
Depends on:
Reported: 2016-01-20 03:36 UTC by Omer Sheikh
Modified: 2023-03-02 22:54 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.1

Keepass icon in the upper left corner (1.69 KB, image/png)
2016-10-18 07:42 UTC, imraro

Note You need to log in before you can comment on or make changes to this bug.
Description Omer Sheikh 2016-01-20 03:36:13 UTC
After upgrading to plasma 5.5.3, legacy system tray icons are now shown in the system tray. They can be clicked and right-clicked like normal icons and work fine. However, the actual icon is replaced with a white square. Applications tested are keepass2 and pidgin

Reproducible: Always

Steps to Reproduce:
1.Launch application that uses legacy tray icons

Actual Results:  
A white square shows up in the system tray.

Expected Results:  
The application icon should have shown up in the tray instead.
Comment 1 imraro 2016-10-18 07:42:32 UTC
Created attachment 101614 [details]
Keepass icon in the upper left corner
Comment 2 Patrick Silva 2019-04-14 15:33:55 UTC
I can't reproduce on my system at least with pidgin 2.13.0.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.2
Comment 3 Konrad Materka 2019-10-08 14:48:05 UTC
Pidgin is working fine, tested on Plasma 5.13.1

Keepass2 is a different story. I tested in on:
- Cinamon: white square
- XFCE4: no icon at all
- Gnome (including Ubuntu) dropped legacy tray icons entirely

This is most probably a bug in Mono (.Net implementation), which is used to run Keepass2. Tray icon is rendered in the corner of much bigger rendering area (273x273), filled with white pixels. xembedsniproxy tries to do it's best to workaround this, but it is not that simple to do this efficiently. Mono should fix that, but Windows Forms module is no longer in active development, so it is unlikely that this will be fixed.

Anyway, maybe I found a better workaround, I will try to prepare a patch.
Comment 4 Konrad Materka 2019-10-10 09:47:01 UTC
Workaround for Keepass2/Mono:
Comment 5 Nate Graham 2019-10-10 14:32:01 UTC
Git commit acf91005b60c82f8381fb119f327f4d443c5b98d by Nate Graham, on behalf of Konrad Materka.
Committed on 10/10/2019 at 14:31.
Pushed by ngraham into branch 'Plasma/5.17'.

[XembedSNIProxy] Check size in each update()

If needed, perform resize in each update().
Client window may be too big, it must be resized to a certain reasonable size. Sometimes resizing in the constructor is not enough because it is too early and the client window is not fully initialized. Even if client window is resized, on first update it reverts back to original size (or just ignores the first request - some kind of a race condition).

In addition, I applied some rules from: https://community.kde.org/Policies/Kdelibs_Coding_Style

Test Plan:
I tested it using keepass2, now it shows better results (still not perfect). Window is resized to 32x32, but icon is only 24x24 it top-left. Better than 273x273 with tiny dot in the corner. This is a workaround for unsolvable bug in Mono - AFAIK Windows Forms are not longer maintained so it won't be fixed.

I tested this change with several other apps for regressions, no issues:
and other I don't remember now. No regressions.

Reviewers: davidedmundson, #plasma, #plasma_workspaces, broulik

Reviewed By: davidedmundson, #plasma, #plasma_workspaces

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24529

M  +42   -41   xembed-sni-proxy/sniproxy.cpp
M  +1    -0    xembed-sni-proxy/sniproxy.h