Bug 409768 - On X11, right-clicking on System Tray app icon causes subsequent left-click on Task Manager apps to activate the tray icon's app instead
Summary: On X11, right-clicking on System Tray app icon causes subsequent left-click o...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: XembedSNIProxy (show other bugs)
Version: 5.24.1
Platform: Neon Linux
: VHI normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 449877 450287 450429 451596 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-13 11:15 UTC by boospy
Modified: 2022-03-26 02:18 UTC (History)
10 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description boospy 2019-07-13 11:15:15 UTC
Looks like i found a bug. I tested it with a fresh neon installation and a fresh userprofile. If you click with the right mousebutton on an application in the taskpanel on the right site, on most application you got an menu. So my example was choqok. But it works with any other application too, nextcloud, steam, sm4k... after the rightclick, click back to desktop or another place, after that on every application you click on the right site on the taskpanel, the same menu opens. But it gets even funnier. Becaues you click on an open application like dolphin, in my case choqok opens instead.

Here is the screencast of this issue: https://darkdevil.osit.cc/index.php/s/NKtsFQmHefET5Pz

Thanks a lot
Comment 1 Rich Johnson 2019-07-14 02:58:41 UTC
I will add to this as I can confirm. If I right click on something in my system tray, Discord as an example, then click anywhere else, when I click on anything in the panel it will popup the last menu I selected. I just confirmed boospy's issue after watching their screencast.
Comment 2 Nate Graham 2019-07-15 22:14:48 UTC
Thanks for the video, that's very helpful! However I'm not able to reproduce it with my icons-only task manager on Plasmas 5.16.2 or with everything built from git master.

Is it just apps in the system tray where this happens, or all items (e.g. Volume, network status, etc)?
Comment 3 Rich Johnson 2019-07-15 22:21:43 UTC
Hey Nate, I just checked, it seems to only happen to non-KDE/Plasma icons. In my case it happens with Chrome, Dropbox, Keybase, Discord, and KeePassX. It does not happen with Network Manager, Volume, Battery, etc.
Comment 4 boospy 2019-07-15 22:23:03 UTC
Yes with all. But it's happens only if you click first on an app in the system tray. After that you click on volume, network, and you can see the issue. 
But if you click fist on volume, network... and after on an app in the system tray, the menu form the app comes up, not that from example volume. So this direction it works right. 

You can also click right on PSI+ after that click left on Kontact and PSI+ comes up.
Comment 5 boospy 2019-07-24 16:00:22 UTC
When can we expect that this bug will be fixed? I think you can understand that this is a bit of a hassle all day in the office. 

Thanks a lot, and if you need more infos, i will do my best :)
Comment 6 Christoph Feck 2019-08-05 19:05:53 UTC
New information was provided; changing status for inspection.
Comment 7 boospy 2019-08-15 15:18:16 UTC
Here the new sharelink. The old was expired ;(

https://darkdevil.osit.cc/index.php/s/enWkcfk38woidmE
Comment 8 Nate Graham 2019-08-15 15:59:22 UTC
If possible, please attach the video to the bug so it's visible forever. :)
Comment 9 David Edmundson 2019-08-15 16:04:38 UTC
For future, yes please attach.
Don't bother now given it should be fixed with 
https://phabricator.kde.org/D22804 which I hope to see merged soon.
Comment 10 Nate Graham 2019-08-15 16:54:32 UTC
Git commit 67c1117fa52d43877626ed2d7e3b5cdf02f3e5df by Nate Graham, on behalf of Konrad Materka.
Committed on 15/08/2019 at 16:54.
Pushed by ngraham into branch 'master'.

[System Tray] Do not send ContextMenu signal twice

Summary:
System Tray sends two "ContextMenu" events which breaks focus.
One is send on mouse pressed, second on mouse clicked. As a result
right click on the system tray icon causes focus to lock on the icon.
If later user clicks somewhere else event is send to the first icon.
Related: bug 376277
FIXED-IN: 5.17.0

Test Plan:
The best to test with Skype for Linux with SNI bridge.

To reproduce:
* Right click on the Skype icon, click on menu item (can be Show Skype)
* Right click on any other icon in system tray (or even any other place on the panel)
* Skype menu will appear

After fix:
* Right click on the Skype icon, click on menu item (can be Show Skype)
* Right click on any other icon in system tray (or even any other place on the panel)
* Correct menu should show

Reviewers: #plasma, broulik, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, apol, plasma-devel, #plasma_workspaces

Tags: #plasma

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

M  +2    -3    applets/systemtray/package/contents/ui/items/AbstractItem.qml
M  +5    -0    applets/systemtray/package/contents/ui/items/PlasmoidItem.qml

https://commits.kde.org/plasma-workspace/67c1117fa52d43877626ed2d7e3b5cdf02f3e5df
Comment 11 boospy 2019-08-15 18:16:28 UTC
Really, Really fine!!! So many Thanks! :) :) :)
Comment 12 boospy 2019-09-07 17:26:10 UTC
When come that fix in KDE? I've updated today application fix. And it is not fixed. Between the time i've updated the files manually.
Comment 13 Nate Graham 2019-09-07 20:00:58 UTC
The "version fixed in" field at the top provides the answer: 5.17.0. This would be Plasma 5.17.0, which is not released yet, so it's no surprise that you don't have the fix yet. :) Once Plasma 5.17 is released and your distro of choice provides it to you, you'll get the fix.
Comment 14 boospy 2019-09-08 11:35:01 UTC
(In reply to Nate Graham from comment #13)
> The "version fixed in" field at the top provides the answer: 5.17.0. This
> would be Plasma 5.17.0, which is not released yet, so it's no surprise that
> you don't have the fix yet. :) Once Plasma 5.17 is released and your distro
> of choice provides it to you, you'll get the fix.

Thanks for the info. We will fix it over puppet. Thanks :)
Comment 15 boospy 2022-02-14 19:57:16 UTC
With Plasma 5.24.0 this bug is back again.
Comment 16 Nate Graham 2022-02-14 22:16:05 UTC
That was a regression which hopefully we just fixed in 5.24.1. Can you check again once that's released tomorrow?
Comment 17 boospy 2022-02-15 08:49:03 UTC
Thanks for the reply. I test it :)
Comment 18 Geno 2022-02-16 02:32:22 UTC
(In reply to Nate Graham from comment #16)
> That was a regression which hopefully we just fixed in 5.24.1. Can you check
> again once that's released tomorrow?

So glad I've finally found a bug report for this issue, really hard to find it without being able to use specific terms. I thought it was an issue on my end when I updated to 5.24.0 about a week ago.

Thanks also boospy for reporting that the issue is back, I can confirm that I also have this issue. In my case Steam seems to always activate it's menu.

I've updated today to 5.24.1 on EndeavourOS, and after a restart I still have this issue.
Comment 19 boospy 2022-02-16 19:11:50 UTC
I can confirm. The exists on 5.24.1 too. The behavior has changed a little. Right-click menu on telegram closes immediately when releasing the mouse button. And the right click on Zoiper (Voipclient) now works again and I don't have to xkill the program anymore.
Comment 20 Nate Graham 2022-02-21 21:29:06 UTC
*** Bug 450287 has been marked as a duplicate of this bug. ***
Comment 21 Stefan Zurucker 2022-02-21 22:36:17 UTC
I can reproduce the issue under Plasma 5.24.1 on X11, but it doesn't seem to occur in a Wayland session (KDE Neon).
Comment 22 Bug Janitor Service 2022-02-22 21:17:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1484
Comment 23 Konrad Materka 2022-02-22 21:17:44 UTC
*** Bug 450429 has been marked as a duplicate of this bug. ***
Comment 24 Konrad Materka 2022-02-22 21:18:42 UTC
*** Bug 449877 has been marked as a duplicate of this bug. ***
Comment 25 Geno 2022-02-22 23:59:05 UTC
I still have this issue on 5.24.2, I'm running on X11.
Comment 26 Konrad Materka 2022-02-25 08:40:48 UTC
Git commit a02d1ca27b577607aa36d038372b3ec39e2376d4 by Konrad Materka.
Committed on 24/02/2022 at 21:48.
Pushed by fusionfuture into branch 'master'.

applets/systemtray: Do not open context menu on mouse pressed for SNI

The prefered is to show context menu on mouse pressed event, not click,
but this causes few issues for SNI.

Some legacy applications still relies on XEmbed to show tray icon.
We use xembedsniproxy to relay the mouse press signals to the XEmbed client
but some applications (including GTK) validate the mouse state.
Mouse released state is expected, but as it is still pressed context
menu does not show.
FIXED-IN: 5.24.3

M  +0    -3    applets/systemtray/package/contents/ui/items/AbstractItem.qml
M  +7    -0    applets/systemtray/package/contents/ui/items/PlasmoidItem.qml

https://invent.kde.org/plasma/plasma-workspace/commit/a02d1ca27b577607aa36d038372b3ec39e2376d4
Comment 27 Fushan Wen 2022-02-25 08:41:22 UTC
Git commit a9d5ea2afd33ee4fb51b6caf0af5a902a3d81352 by Fushan Wen, on behalf of Konrad Materka.
Committed on 25/02/2022 at 08:41.
Pushed by fusionfuture into branch 'Plasma/5.24'.

applets/systemtray: Do not open context menu on mouse pressed for SNI

The prefered is to show context menu on mouse pressed event, not click,
but this causes few issues for SNI.

Some legacy applications still relies on XEmbed to show tray icon.
We use xembedsniproxy to relay the mouse press signals to the XEmbed client
but some applications (including GTK) validate the mouse state.
Mouse released state is expected, but as it is still pressed context
menu does not show.
FIXED-IN: 5.24.3


(cherry picked from commit a02d1ca27b577607aa36d038372b3ec39e2376d4)

M  +0    -3    applets/systemtray/package/contents/ui/items/AbstractItem.qml
M  +7    -0    applets/systemtray/package/contents/ui/items/PlasmoidItem.qml

https://invent.kde.org/plasma/plasma-workspace/commit/a9d5ea2afd33ee4fb51b6caf0af5a902a3d81352
Comment 28 Geno 2022-03-10 02:48:58 UTC
Updated to 5.24.3 yesterday and it seems to have solved the issue with Steam and Discord for me. Thanks!
Comment 29 boospy 2022-03-10 19:23:42 UTC
Yes it works now. Very thanks. Good work! :)
Comment 30 Nick Stefanov 2022-03-10 22:47:36 UTC
No problems at all, thank you!
Comment 31 Nate Graham 2022-03-26 02:18:39 UTC
*** Bug 451596 has been marked as a duplicate of this bug. ***