Bug 489286 - Since Plasma 6.1, the icons in systray for gtk2 applications do not work on Wayland after the first click
Summary: Since Plasma 6.1, the icons in systray for gtk2 applications do not work on W...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: XembedSNIProxy (show other bugs)
Version: 6.1.3
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression, wayland
: 488778 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-06-27 07:16 UTC by painless roaster
Modified: 2024-10-21 15:21 UTC (History)
10 users (show)

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


Attachments
simple test application (1.16 KB, text/x-csrc)
2024-06-27 07:16 UTC, painless roaster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description painless roaster 2024-06-27 07:16:25 UTC
Created attachment 171065 [details]
simple test application

since version 6.1 the icons in systray for gtk2 applications do not work

I attach a simple test application

try:
gcc systray.c -o systray `pkg-config --cflags --libs gtk+-2.0`
./systray

try right click on new icon in systray
result: no response
Comment 1 Marco Martin 2024-06-27 11:31:27 UTC
can confirm with the test app
Comment 2 Marco Martin 2024-06-27 11:36:53 UTC
edit: i can only *partly* reproduce it: if i start that systray test app, right clicking works and shows a "quit" entry, which all works.

But, if i left click it, then after that right click won't work anymore. can you confirm?
Comment 3 Marco Martin 2024-06-27 11:56:24 UTC
reverting xembedsniproxy doesn't seem to solve the issue for me, which is more "click forwarding only works once" than not working at all
Comment 4 painless roaster 2024-06-27 12:20:52 UTC
(In reply to Marco Martin from comment #2)
> edit: i can only *partly* reproduce it: if i start that systray test app,
> right clicking works and shows a "quit" entry, which all works.
> 
> But, if i left click it, then after that right click won't work anymore. can
> you confirm?

Even the first right click doesn't work for me. I am testing on Fedora FC40.
But even your testing conclusion confirms the problem. There is a bug somewhere since 6.1 that affects gtk2 applications.
Comment 5 painless roaster 2024-06-27 13:05:03 UTC
It only not working with wayland.
If I install plasma-workspace-x11 and use x11 instead of wayland, it works.

related ticket: https://bugs.kde.org/show_bug.cgi?id=488778
Comment 6 Nate Graham 2024-06-27 14:37:57 UTC
*** Bug 488778 has been marked as a duplicate of this bug. ***
Comment 7 Bug Janitor Service 2024-06-27 15:27:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4487
Comment 8 Bug Janitor Service 2024-06-27 15:27:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4487
Comment 9 Jacob 2024-07-01 03:13:03 UTC
having this problem as well with 'hexchat' arch linux with kde 6.1
Comment 10 Nate Graham 2024-07-02 18:04:48 UTC
*** Bug 489590 has been marked as a duplicate of this bug. ***
Comment 11 Bug Janitor Service 2024-07-08 12:08:07 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4505
Comment 12 David Edmundson 2024-07-09 10:52:29 UTC
Git commit 7ee0f7a2cdac1a348af3f634ad3c8c2073b55ce6 by David Edmundson, on behalf of David Redondo.
Committed on 09/07/2024 at 10:33.
Pushed by davidedmundson into branch 'master'.

xembedsniproxy: Warp pointer to click location on wayland

Some clients track pointer focus and ignore clicks if they think
they dont have a window under the cursor. On Wayland pointer focus
is driven by the compositor - the client receives a click without
a prior enter event. To workaround this warp the pointer to the
click position before clicking which generates the needed enter.
FIXED-IN:6.1.3

M  +4    -0    xembed-sni-proxy/sniproxy.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/7ee0f7a2cdac1a348af3f634ad3c8c2073b55ce6
Comment 13 David Edmundson 2024-07-09 11:07:47 UTC
Git commit e2cc2c2aab112edd29d1f713df1769c068f3f20f by David Edmundson, on behalf of David Edmundson.
Committed on 09/07/2024 at 10:53.
Pushed by davidedmundson into branch 'Plasma/6.1'.

xembedsniproxy: Warp pointer to click location on wayland

Some clients track pointer focus and ignore clicks if they think
they dont have a window under the cursor. On Wayland pointer focus
is driven by the compositor - the client receives a click without
a prior enter event. To workaround this warp the pointer to the
click position before clicking which generates the needed enter.
FIXED-IN:6.1.3


(cherry picked from commit 7ee0f7a2cdac1a348af3f634ad3c8c2073b55ce6)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +4    -0    xembed-sni-proxy/sniproxy.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/e2cc2c2aab112edd29d1f713df1769c068f3f20f
Comment 14 Fushan Wen 2024-07-09 12:52:45 UTC
Git commit c13cb9026a467e2469ec266a0b4ba156e6152e6a by Fushan Wen.
Committed on 09/07/2024 at 12:33.
Pushed by fusionfuture into branch 'master'.

appiumtests: test xembedsniproxy with real click

M  +61   -58   appiumtests/applets/systemtraytest.py

https://invent.kde.org/plasma/plasma-workspace/-/commit/c13cb9026a467e2469ec266a0b4ba156e6152e6a
Comment 15 Patrick Silva 2024-07-20 13:26:48 UTC
Not completely fixed on Plasma 6.1.3:

Steps to reproduce:
1. open Hexchat irc client
2. right-click on the tray icon of Hexchat
3. dismiss the context menu by clicking on Hexchat window
4. right or left click on the tray icon of Hexchat

Result: a subtle animation with the tray icon happens after the last step, nothing else

Operating System: Arch Linux 
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Graphics Platform: Wayland
Comment 16 Nate Graham 2024-07-22 15:59:40 UTC
I can't reproduce that with current git master, FWIW.
Comment 17 TraceyC 2024-07-22 16:01:31 UTC
I was unable to reproduce either
Plasma 6.1.3 using Hexchat
git-master using the sample systray application
Comment 18 Michael Torrie 2024-08-01 02:47:09 UTC
This bug is very much still present in 6.1.3.  Running Fedora 40 with KDE Wayland 6.1.3.  Both hexchat and pidgin tray icons do not work still.  The person who said they couldn't reproduce with hexchat and plasma 6.1.3 was apparently using X11, not wayland.

Any chance of re-opening this bug?  It's not the end of the world, but it would be nice to use pidgin again.
Comment 19 Michael Torrie 2024-08-01 03:52:45 UTC
while it's not working in 6.1.3, it does appear to work when I build from git master.  so hopefully in the next release we'll see it working again.
Comment 20 Michael Torrie 2024-08-06 23:23:52 UTC
Hmm. After working for a few days, it's now not working again. This is with the binary from git master.  So it appears the bug is not yet truly fixed.
Comment 21 mdogg 2024-08-20 19:40:46 UTC
I have 6 applications that are configured to 'Minimize to the Systray when Closed'.  Signal-Desktop, Spotify, KeePassXC, SMPlayer, DeaDBeeF, and HexChat.  All of these apps behave as expected when logged into x11, however in a Wayland session, DeadBeeF and HedChat do not.

HexChat - The HexChat app icon appears in the Systray, and when hovering over the HexChat icon, a pop-up title "HexChat" appears.  Left or right-clicking the icon does nothing.  The application cannot be brought back up once minimized to the Systray in Wayland (at least I can't figure out how to bring it back up).  Running 'hexchat' again brings up a brand new instance, which isn't helpful.

DeaDBeeF - Hitting the 'x' to close the app/minimize it to he Systray causes DeaDBeeF to completely disappear, however the application continues to run (continues playing audio files) just as it should - No icon in the Systray or anywhere else.  Running the program from the Plasma 6 launcher or running 'deadbeef' from bash brings the application back up without any process interruption, which is nice.  The only issue with this application is that in Wayland, it vanishes rather than entering the Systray as it should - but at least it is possible to have it re-present itself on the Wayland desktop.

The link below provides some technical info about my hardware, OS, etc. -->
https://www.mdogg.com/mdogg/temp/mdogg-SysInfo_kde-wayland_bug-489286.txt

Thank you for your time and consideration, and I look forward to a resolution in Plasma version 6.2.0
Comment 22 Konrad Materka 2024-08-22 20:07:28 UTC
I cannot reproduce with HexChat.
Plasma 6.1.80 (compiled from master), KDE Neon with libwayland 1.22, wayland-protocols 1.36,  XWayland 24.1 (compiled from sources)
Comment 23 Konrad Materka 2024-08-22 20:16:02 UTC
I CAN reproduce with HexChat and XWayland from KDE Neon - 23.2.4! Both Plasma 6.1.4 and compiled from master

So the problem is with too old XWayland. IIRC recently there were some improvements in xembedsniproxy that require newer XWayland.
Comment 24 mdogg 2024-10-17 18:34:12 UTC
Howdy, folks!

I just applied a new snapshot to openSUSE Tumbleweed and checked to see if the 'minimize to systray' issue I was having in Wayland with certain applications was resolved.  

I am happy to say that DeaDBeeF is now the only application that does not show up in the systray, so if it's configured to minimize to tray it disappears completely.  It's easy enough to close it out from the CLI with 'deadbeef --quit'.  It is strange that DeaDBeeF is the only application with an issue that Plasma 6.2.x did not resolve, though.

Should I just consider finding a different application to use when I want to play .flac and .mp3 audio files?  Thanks to everyone for all of the help and time you've put into this.  I sincerely appreciate it!

The below URL lists some details about what I'm running in case you want to see what has changed between now and my system back when I created 'Comment 21':
https://www.mdogg.com/mdogg/temp/mdogg-SysInfo_kde-wayland_bug-489286_2024-10-17_update_.txt
Comment 25 Nate Graham 2024-10-21 15:21:37 UTC
That issue with DeaDBeeF seems different from this one.