Bug 449633

Summary: System Tray reopens popup instead of closing it when located on a desktop containment
Product: [Plasma] plasmashell Reporter: ratijas <me>
Component: ContainmentAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, materka, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: System Tray applet - reopens on desktop

Description ratijas 2022-02-04 23:42:45 UTC
Created attachment 146287 [details]
System Tray applet - reopens on desktop

SUMMARY

Unlike on a panel, when the system tray applet is placed on a desktop, it doesn't let you close the popup by clicking on the same applet icon again. The mere mouse key press (down) on an icon makes popup lose the focus, so it closes; and then the key release (up) accidentally re-activates an applet again, thus opening the popup.

STEPS TO REPRODUCE
1. Put System Tray applet on a desktop.
2. Click on any applet, e.g. Audio Volume.
3. Popup opens up.
4. Click on that applet again.

OBSERVED RESULT
Popup briefly closes, and opens up again.

EXPECTED RESULT
Popup should close, but only when the mouse key is released (inside the icon, of course). And generally it should behave just like on a panel.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970M/PCIe/SSE2

ADDITIONAL INFORMATION

Possibly related issue https://bugs.kde.org/show_bug.cgi?id=449533 was fixed recently. I don't understand what that fix actually was doing, but there's is definitely some focus preserving inconsistency in panels vs. desktop containments.
Comment 1 Nate Graham 2022-02-05 01:12:40 UTC
Can reproduce.
Comment 2 ratijas 2022-02-05 03:16:58 UTC
Long story short, panels don't take over the focus when clicked, unlike desktop containments. This has nothing to do with the system tray applet itself, and is actually reproducible with any expandable applet in compact mode.

Interesting observations:

1. If clicking very fast, sometimes it takes much longer than average from the time the popup starts hiding to the time it re-appears.
2. Holding down the left mouse button before letting is go visualizes the process on hiding on press and re-appearing on release.
3. Holding button for too long causes containment to enter Edit mode.
Comment 3 ratijas 2022-06-21 16:39:00 UTC
Fixed in https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1434

Kinda a duplicate, but not quite because those fixes are on a per-applet basis, not on a framework level unfortunately.