https://bugs.winehq.org/show_bug.cgi?id=45899
Bug ID: 45899 Summary: Tray icons don't react when you left click or right click on them Product: Wine-staging Version: 3.16 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: guih.rox@gmail.com CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
All programs with a tray icon that I've tested so far with Wine Staging 3.16 don't work when you try to interact with it, by trying to left or right clicking on it.
This is not reproducible with Vanilla Wine however.
There's a small program called TurnFlash (https://www.nirsoft.net/utils/tflash2.html) that can be used to observe this behavior:
Download link: https://www.nirsoft.net/utils/tflash210.zip SHA-1 sum for tflash.exe: 15f877867b45d51a2a8257494bb3128f1b0d087f
After you run it, you should get no output from wine, but you'll see a blue icon added to the system tray of your Desktop Environment (in my case, it's KDE Plasma 5.13.5).
The first thing I tried was checking checked my journal using `journalctl -f`, this is the message I got:
Sep 27 03:22:06 arch plasmashell[970]: QQuickItem::stackAfter: Cannot stack StatusNotifierItem_QMLTYPE_345(0x558c6fb48b50, parent=0x558c6caa47b0, geometry=0,0 0x0) after StatusNotifierItem_QMLTYPE_345(0x558c6f972d20), which must be a sibling
After that, I tried left clicking the tray icon -- it did nothing at all, and no logs. But right clicking it made the following message show up in the journal:
Sep 27 03:24:36 arch plasmashell[970]: Could not find DBusMenu interface, falling back to calling ContextMenu()
I should mention that I get the exact same messages using Vanilla Wine, the only difference is that interacting with the tray icon works perfectly fine.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #1 from Zebediah Figura z.figura12@gmail.com --- Are you aware of which Staging patch causes this regression? If not, can you perform a regression test to find out?
(Though it might be quicker to test all of the winex11 patches, since it's not especially likely to be anything else.)
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #2 from Guilherme Silva guih.rox@gmail.com --- Created attachment 62420 --> https://bugs.winehq.org/attachment.cgi?id=62420 Wine-staging 3.5 system tray interaction works
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #3 from Guilherme Silva guih.rox@gmail.com --- Created attachment 62421 --> https://bugs.winehq.org/attachment.cgi?id=62421 Wine-staging 3.6 system tray icon looks good but it doesn't work
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #4 from Guilherme Silva guih.rox@gmail.com --- I tried running git bisect, but as I'm not too familiar with the wine compiling process altogether, I was getting some errors while applying the staging patches in version 3.6 and I didn't know if I could safely ignore them or how to fix them. So instead, I downgraded the pre-compiled wine-staging package in Arch Linux and the last version which tray icons still worked is 3.5. Starting from version 3.6 it stops working. While testing version 3.5 and downwards I noticed that the system tray icon this black background, whilst in version 3.6 the background was transparent like it's supposed to be, but the functionality was gone.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #5 from Guilherme Silva guih.rox@gmail.com --- Okay, I was finally able to use git bisect (hopefully I did everything right) :D
bd8446fa5709de6203e09768934522364228fd3f is the first bad commit commit bd8446fa5709de6203e09768934522364228fd3f Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Thu Apr 5 08:09:25 2018 +1000
Rebase agains 3263d51a1fd86abf195c5be224f6fdb4db284b53
:040000 040000 e705bde5b4b886a1c6dd7d1b0c94a61bd57f1dba ed73368cbfece5b5e3046949ae4bde9b9ba0a486 M patches
I hope it helps.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #6 from Zebediah Figura z.figura12@gmail.com --- Apologies, that's not what I meant; I should have been more clear.
I meant to bisect Staging against current master—i.e. to apply all patches with `patchinstall.sh --all --backend=git-am --force-autoconf`, and then to bisect that against master. That should (hopefully) determine which patch in Staging causes the problem.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #7 from Guilherme Silva guih.rox@gmail.com --- Thanks a lot, that's actually much easier than what I was doing. Hahah
I think I've found the right one this time.
7f52365c632b554e9cd26f0a37f237e1299f1e71 is the first bad commit commit 7f52365c632b554e9cd26f0a37f237e1299f1e71 Author: Dmitry Timoshkov dmitry@baikal.ru Date: Wed May 17 23:55:55 2017 +0800
server: Add support for a layered window region. (v3)
:040000 040000 3781c05266d1b57b0e7a8304631fb22fcc470a8c 7489cf46ad6460c6927c16cafc31d1912cba1fa1 M dlls :040000 040000 53c3c42980871bc577ecf8d5978c6db53e9ebc1f e52a0cae77c3c359ce0654b8693bd035b1265004 M include :040000 040000 bf456f6d184a143a30c37b209b828d8fb0cb4e22 714097355cfc3da410ecf49646ce54daff10251b M server
(Patch location: patches/user32-Mouse_Message_Hwnd/0005-server-Add-support-for-a-layered-window-region.-v2.patch)
In my first attempt at this, I applied all patches against Wine 3.16, but upon compilation I started getting too much errors, and even `bisect skip`ing them didn't help much. I also know nothing about C programming to even consider fixing those errors, so I decided to patch Wine 3.6 instead, which is the version that introduced the problem in the first place. Thankfully, it went butter smooth!
Ultimately, to be sure that was indeed the problematic patch, I patched Wine 3.16 without the 'user32-Mouse_Message_Hwnd' patchset and that finally fixed systray problem I was having! The only minor issue I found is that the cursor disappears after you right-click the tray icon, but moving the cursor slightly makes it appear again, and it won't happen again in a second try. Ah, left-clicking also works.
That's all I guess...
https://bugs.winehq.org/show_bug.cgi?id=45899
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dmitry@baikal.ru
--- Comment #8 from Zebediah Figura z.figura12@gmail.com --- Thanks.
Dmitry, since this is your patchset, would you mind taking a look?
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #9 from Guilherme Silva guih.rox@gmail.com --- You're most welcome. And _thank you_ guys for wine. Just a side note: I'm still getting the same messages in the journal even with the systray icon completely functioning. So I suppose it's safe to ignore them.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru --- I just tested an application that creates a tray icon and I can't reproduce the problem: mouse clicks on a tray icon are correctly passed to the app. Then I tested with tflash.exe referenced in the first comment and can't reproduce the problem either.
This is under MATE WM.
Zebediah, could you please test the tflash.exe behaviour and report whether it works for you?
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #11 from Dmitry Timoshkov dmitry@baikal.ru --- It would be helpful to independently confirm the regression testing result.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #12 from Guilherme Silva guih.rox@gmail.com --- I think I've found the culprit. It's the KWin compositor.
I've been trying to reproduce this with some different desktop environments (Cinnamon, MATE, XFCE) and so far I've been only able to reproduce this on KDE. So I just tried disabling the KWin compositor (Alt+Shift+F12), then I opened TFlash again and the issue was gone. It'd be better if somebody else could reproduce it though, just to be 100% sure.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #13 from Guilherme Silva guih.rox@gmail.com --- Okay, so here's a workaround for now:
1. Disable KWin compositor (Ctrl+Shift+F12) 2. Run the program with wine 3. Re-enable KWin compositor (Ctrl+Shift+F12) 4. The system tray works as expected
https://bugs.winehq.org/show_bug.cgi?id=45899
i+winehq@hexchain.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |i+winehq@hexchain.org
--- Comment #14 from i+winehq@hexchain.org --- I have the same problem, also with wine-staging on KDE, and the above workaround also works for me.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #15 from Guilherme Silva guih.rox@gmail.com --- (In reply to Guilherme Silva from comment #13)
Okay, so here's a workaround for now:
- Disable KWin compositor (Ctrl+Shift+F12)
- Run the program with wine
- Re-enable KWin compositor (Ctrl+Shift+F12)
- The system tray works as expected
Oops, the correct shortcut is Alt+Shift+F12.
(In reply to hexchain from comment #14)
I have the same problem, also with wine-staging on KDE, and the above workaround also works for me.
Great! Thanks for testing
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #16 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Guilherme Silva from comment #12)
I think I've found the culprit. It's the KWin compositor.
I've been trying to reproduce this with some different desktop environments (Cinnamon, MATE, XFCE) and so far I've been only able to reproduce this on KDE. So I just tried disabling the KWin compositor (Alt+Shift+F12), then I opened TFlash again and the issue was gone. It'd be better if somebody else could reproduce it though, just to be 100% sure.
Could you please report a bug to KWin developers? Thanks.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #17 from Guilherme Silva guih.rox@gmail.com --- Done: https://bugs.kde.org/show_bug.cgi?id=399234
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #18 from hexchain i+winehq@hexchain.org --- A KWin developer has replied: https://bugs.kde.org/show_bug.cgi?id=399234#c4
(Sorry if this is annoying, I do really want to move this issue forward)
https://bugs.winehq.org/show_bug.cgi?id=45899
fresa arichikaari.me@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |arichikaari.me@gmail.com
--- Comment #19 from fresa arichikaari.me@gmail.com --- fedora 29 kde 5.13.5 same problem with wine version>3.16
https://bugs.winehq.org/show_bug.cgi?id=45899
Tom Englund tomenglund26@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tomenglund26@gmail.com
--- Comment #20 from Tom Englund tomenglund26@gmail.com --- still happends with plasma 5.15.2 and wine staging 4.2 on archlinux, the icons do show up but is not doing anything on clicks/input
https://bugs.winehq.org/show_bug.cgi?id=45899
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |o.dierick@piezo-forte.be See Also| |https://bugs.kde.org/show_b | |ug.cgi?id=399234
https://bugs.winehq.org/show_bug.cgi?id=45899
pattietreutel katyaberezyaka@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |katyaberezyaka@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=45899
andy andy86@fastwebnet.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |andy86@fastwebnet.it
https://bugs.winehq.org/show_bug.cgi?id=45899
Ville Aakko ville.aakko@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ville.aakko@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=45899
Konrad Materka kmaterka@wp.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kmaterka@wp.pl
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #21 from Konrad Materka kmaterka@wp.pl --- Let me summarize the situation, as I understand it: KDE implements proxy between xembed and SNI (using xembedsniproxy). Tray icon is rendered off screen and "duplicated" icon is sent trough SNI (D-Bus) protocol to the KDE system notification applet. Mouse clicks are not direct but emulated on the top-left corner of the wine icon. When tray icon has some transparency in top-left corner and "window region" patch is applied, mouse click is ignored by wine, probably ends up "clicking through". I don't know why it works with KDE compositing disabled.
Fix in the KDE will be tricky. The best would be to send mouse clicks where they occurred, not in the top-left corner, but it is hard to get information where notification icon is rendered on the KDE notification area.
Maybe region should not be applied on tray icons? Windows 10 is not doing that, I can click on the transparent space of the icon (or even empty space around the icon!) and it still receives the event and context menu shows at the pointer location.
Another solution would be to include this patch: https://github.com/Tk-Glitch/PKGBUILDS/blob/master/wine-tkg-git/wine-tkg-pat... It adds SNI / AppIndicator support, so that when available wine will use SNI to show tray icon. I don't know how reliable the patch is, I never tested it. As a bonus, it would be compatible with Wayland.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #22 from Zebediah Figura z.figura12@gmail.com --- I guess from my perspective (though Alexandre may disagree on what KDE's responsibilities are), the real question is whether KDE wants masks on tray icons to work at all. If not, then we can work around it by getting rid of our masks, but if so, it's on their plate to fix.
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #23 from Konrad Materka kmaterka@wp.pl --- I checked how it works on XFCE: mask is working as expected, both plain wine and staging. When I click on the transparent area clicks do nothing. It is not how MS Windows works, but this should not be a problem for end users.
I'm not a KDE developer nor I have any decision power, I just try to fix it on KDE side. In my opinion this is an issue on KDE side, unfortunately. Xembed is deprecated in KDE, current implementation of xembed tray icons is just a workaround or hack. It is just a proxy between SNI and xembed, on SNI click event KDE sends click events always in the top-left corner (0,0) of the icon. It is not possible to get information where the icon is rendered nor exact coordinates of the click relative to the tray icon. There is no easy fix, I tried several things and all of them break compatibility with native apps.
Off topic: do you know how to disable window mask using XCB? Is it even possible after the X window is created?
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #24 from Konrad Materka kmaterka@wp.pl --- Forget about window mask change - I found how to do it, it won't work. I will use xcb_shape_get_rectangles to get clickable area.
I guess there is nothing to be done on wine side. I will continue in KDE bug tracker: https://bugs.kde.org/show_bug.cgi?id=399234
https://bugs.winehq.org/show_bug.cgi?id=45899
--- Comment #25 from Konrad Materka kmaterka@wp.pl --- Fixed in KDE: https://bugs.kde.org/show_bug.cgi?id=399234 https://phabricator.kde.org/D22767 It will be released with next KDE Plasma release 5.17 (check https://community.kde.org/Schedules/Plasma_5 for dates).
This bug report can be closed.
https://bugs.winehq.org/show_bug.cgi?id=45899
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |NOTOURBUG
--- Comment #26 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Konrad Materka from comment #25)
Fixed in KDE: https://bugs.kde.org/show_bug.cgi?id=399234 https://phabricator.kde.org/D22767 It will be released with next KDE Plasma release 5.17 (check https://community.kde.org/Schedules/Plasma_5 for dates).
This bug report can be closed.
Thank you.
https://bugs.winehq.org/show_bug.cgi?id=45899
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #27 from Zebediah Figura z.figura12@gmail.com --- (In reply to Konrad Materka from comment #25)
Fixed in KDE: https://bugs.kde.org/show_bug.cgi?id=399234 https://phabricator.kde.org/D22767 It will be released with next KDE Plasma release 5.17 (check https://community.kde.org/Schedules/Plasma_5 for dates).
This bug report can be closed.
Closing then.
https://bugs.winehq.org/show_bug.cgi?id=45899
andy andy86@fastwebnet.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|andy86@fastwebnet.it |