Bug 414667 - Wine systray icons does not respond to clicks with multi monitor
Summary: Wine systray icons does not respond to clicks with multi monitor
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: XembedSNIProxy (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-29 20:21 UTC by Eliphas
Modified: 2019-12-27 12:27 UTC (History)
3 users (show)

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


Attachments
Monitor layouts (35.73 KB, image/png)
2019-11-29 20:21 UTC, Eliphas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eliphas 2019-11-29 20:21:19 UTC
Created attachment 124188 [details]
Monitor layouts

SUMMARY
When using multi-monitor in some layouts, the wine systray app icons does not respond to mouse click.

STEPS TO REPRODUCE
1. Use multi-monitor setup with some less-used layouts
2. Open wine exe that have a systray like tflash.exe (url in the additional info)
3. Click on the tray icon

OBSERVED RESULT
No response to left/right click.

EXPECTED RESULT
Response to left click (icon on/off) and right click (context menu)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon Testing Edition / 5.17.3

KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.2

ADDITIONAL INFORMATION
This started out as I was trying to help out on bug #399234.

Executable tflash.exe from https://www.nirsoft.net/utils/tflash210.zip

Log of xembedsniproxy below

First window in normal layout, second window in reverse layout

In every tests, the primary screen with the taskbar and systray is the laptop screen.

Will attach tested monitor layouts.



eliphas@T410:~$ QT_LOGGING_RULES="*kde*=true" xembedsniproxy
kde.xembedsniproxy: starting
kde.xembedsniproxy: Manager selection claimed
org.kde.kwindowsystem: Loaded plugin "/usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemX11Plugin.so" for platform "xcb"
kde.xembedsniproxy: trying to dock window  98566154
kde.xembedsniproxy: adding damage watch for  98566154
kde.xembedsniproxy: Received click 1 with passed x*y 1127 881
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 1 with passed x*y 1124 883
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 1 with passed x*y 1126 881
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 1 with passed x*y 1124 883
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 3 with passed x*y 1124 883
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: trying to undock window  98566154
kde.xembedsniproxy: trying to dock window  98566154
kde.xembedsniproxy: adding damage watch for  98566154
kde.xembedsniproxy: Received click 1 with passed x*y 1128 1238
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 3 with passed x*y 1127 1241
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 1 with passed x*y 1130 1244
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: Received click 3 with passed x*y 1129 1243
kde.xembedsniproxy: Click point: QPoint(4,4)
kde.xembedsniproxy: trying to undock window  98566154
Comment 1 Eliphas 2019-11-29 20:27:56 UTC
Looks like the bug only occurs when first X,Y = 0,0 is not in primary monitor.

When second screen are up or left of the primary, the 0,0 is either "floating up/left" or in the second screen.
Comment 2 Konrad Materka 2019-12-02 14:40:17 UTC
Thank you for the very detailed report, the attached picture is really helpful! I think I know where the problem is.
Comment 3 Konrad Materka 2019-12-03 09:04:14 UTC
This is specific to Wine which makes it more difficult to fix. I tested using XChat and icon is working properly.
When (0,0) coordinates are not in the boundaries of the primary screen then Wine behaves strangely. I need to investigate it further to understand what exactly is happening.
Comment 4 Konrad Materka 2019-12-11 16:10:52 UTC
This is a Wine bug, I reported it:
https://bugs.winehq.org/show_bug.cgi?id=48269

I found a workaround, I will prepare a patch.
Comment 5 Konrad Materka 2019-12-18 12:34:05 UTC
I found a proper solution (Wine bug should be fixed anyway):
https://phabricator.kde.org/D26079
Comment 6 Konrad Materka 2019-12-18 13:04:19 UTC
Git commit 24f75b2fda71c76542452da8c6ea39b39a5b4c4c by Konrad Materka.
Committed on 18/12/2019 at 13:03.
Pushed by kmaterka into branch 'master'.

[XembedSNIProxy] Redirect and handle structure requests on the embedded window.

Summary:
When the window is embedded, it should not request position change. Sometimes applications are misbehaving and ignore this constrain. We need to capture all structure requests (position or size change) and ignore them. In other words, we must be a window manager for the embedded window.

Test Plan:
0. You need multiples screens to test this
1. Configure screens so that (0,0) is not on the primary screen
2. Run any Windows app with tray icon using Wine
3. Left click event should work correctly

Reviewers: #plasma_workspaces, #plasma, davidedmundson

Reviewed By: #plasma_workspaces, #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

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

M  +7    -0    xembed-sni-proxy/fdoselectionmanager.cpp
M  +25   -13   xembed-sni-proxy/sniproxy.cpp
M  +1    -0    xembed-sni-proxy/sniproxy.h

https://commits.kde.org/plasma-workspace/24f75b2fda71c76542452da8c6ea39b39a5b4c4c
Comment 7 Konrad Materka 2019-12-19 12:45:39 UTC
Git commit 21a89dd6e1aed60a3dc8cc20009174ea0a6a6f1e by Konrad Materka.
Committed on 19/12/2019 at 12:45.
Pushed by kmaterka into branch 'master'.

[XembedSNIProxy] Regression - really resize instead of notifying only.

Summary:
Regression introduced in previous commit, review D25777. Tray icons should have an ability to resize. If not, icons smaller than 32x32 will render incorectly. In addition, do not notify using xcb_configure_notify_event_t, in some cases (Wine) it messes up the event handling.
FIXED-IN: 5.18.0

Test Plan: Tested with keepass2, keepassx, pidgin, xchat, hexchat, tuxguitar, liferea, wine tflash.exe, workrave, stardict

Reviewers: #plasma_workspaces, #plasma, davidedmundson

Reviewed By: #plasma_workspaces, #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

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

M  +4    -2    xembed-sni-proxy/fdoselectionmanager.cpp
M  +13   -18   xembed-sni-proxy/sniproxy.cpp
M  +1    -1    xembed-sni-proxy/sniproxy.h

https://commits.kde.org/plasma-workspace/21a89dd6e1aed60a3dc8cc20009174ea0a6a6f1e
Comment 8 Eliphas 2019-12-26 13:44:29 UTC
Hello!

Should it be released in the unstable or testing repos or only when the version changes to 5.18?

Tried now on current testing 5.17.4+p18.04+git20191221 and unstable 5.17.4+p18.04+git20191224 with same results.

Thank you!
Comment 9 Konrad Materka 2019-12-27 12:27:55 UTC
Changes will land in version 5.18, beta (5.17.90) should be released on 2020-01-16. This fix was to big to be included in 5.17.5.
AFAIK there are no pre-build packages from master branch.