Bug 449533

Summary: «Clipboard» and «Audio Volume» applets won't close their popup when clicked on an icon in system tray
Product: [Plasma] plasmashell Reporter: ratijas <me>
Component: System Tray widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, justin.zobel, materka, nate, noahadvs
Priority: VHI Keywords: regression
Version First Reported In: 5.23.90   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.24
Sentry Crash Report:

Description ratijas 2022-02-03 00:23:13 UTC
SUMMARY

Out of all applets in system tray, I lost ability to close popup (Full Representation as called internally by Plasma/Plasmoid) by clicking again on icons of «Clipboard» and «Audio Volume» applets.


STEPS TO REPRODUCE
1. Have a system tray applet somewhere on a panel (not on a desktop — that's another can of worms).
2. Click on either «Clipboard» or «Audio Volume» icon.
3. Click on it again.

OBSERVED RESULT
Popup didn't close.

EXPECTED RESULT
Popup should've closed.

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.4-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

plasma-desktop: c2b4113722d395f1c7122689c119555f3ed7c0eb
plasma-workspace: a61b3faecb1e13c8100084f14e6646721c6e48bb
plasma-framework: 602ab69160de190eff7d9daa45ac7a9c0e489764

ADDITIONAL INFORMATION
Comment 1 guimarcalsilva 2022-02-03 16:56:35 UTC
Notifications and Vault also can'
Comment 2 guimarcalsilva 2022-02-03 16:57:51 UTC
Oops, ignore the previous incomplete comment. I meant to say Plasma Vaults and the notification applet also can't be dismissed by clicking on their icon again.
Comment 3 Nate Graham 2022-02-03 17:05:31 UTC
Can confirm, seems to be a regression from sometime yesterday when this was working for me.
Comment 4 Nate Graham 2022-02-03 19:50:10 UTC
Git bisect says this was caused by the following commit:

d58b9eabf3959473030c685690277d9d2f03f388 is the first bad commit
commit d58b9eabf3959473030c685690277d9d2f03f388
Author: Noah Davis <noahadvs@gmail.com>
Date:   Mon Jan 31 09:21:50 2022 -0500

    systemtray AbstractItem: Improve touch feedback
    
    Applets in PlasmoidItem were blocking events from reaching the
    ToolTipArea, so I moved the on hover logic to the AbstractItem's
    MouseArea and put the MouseArea over the iconContainer. The
    iconContainer is the parent of applets. Presses tend to hit the center,
    which is where the applet is, preventing ToolTipArea::containsMouse from
    being true and preventing the highlight from moving to the pressed item.
    
    Hopefully this doesn't cause duplicate actions when events reach the
    applet. I tested the patch on the nightcolor applet and all the other
    default applets and didn't see anything wrong. I think this may be
    because the signals are sending QML MouseEvents to the applets, causing
    them to be accepted if the applet can accept them. Then when the signal
    handlers are done, since the events are already accepted, they should
    not move beyond the MouseArea and cause another round of event handling.

 .../package/contents/ui/items/AbstractItem.qml     | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)


That commit made it into the stable branch which just got tarred today. Raising to VHI priority as this is a serious regression we shouldn't ship with.
Comment 5 Bug Janitor Service 2022-02-03 20:52:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1434
Comment 6 Ismael Asensio 2022-02-03 21:34:22 UTC
Git commit a321bbcefee7d221fc2fd52a569bdb8740b9dd0b by Ismael Asensio.
Committed on 03/02/2022 at 20:46.
Pushed by ngraham into branch 'master'.

systray: Fix systray collapsing on click

The MouseArea in AbstractItem needs to be above applets
when it's in the grid hidden area so that it can receive
hover events while the mouse is over an applet

But when the applet is shown as an icon on the regular
systray it needs to be below so the PlasmoidItem `onClick`
takes precedence and systray collapsing works.
FIXED-IN: 5.24

M  +4    -3    applets/systemtray/package/contents/ui/items/AbstractItem.qml

https://invent.kde.org/plasma/plasma-workspace/commit/a321bbcefee7d221fc2fd52a569bdb8740b9dd0b
Comment 7 Nate Graham 2022-02-03 21:35:15 UTC
Git commit 1fcf3553ae2ff25a8404c82e76fc3e13d36cb650 by Nate Graham, on behalf of Ismael Asensio.
Committed on 03/02/2022 at 21:35.
Pushed by ngraham into branch 'Plasma/5.24'.

systray: Fix systray collapsing on click

The MouseArea in AbstractItem needs to be above applets
when it's in the grid hidden area so that it can receive
hover events while the mouse is over an applet

But when the applet is shown as an icon on the regular
systray it needs to be below so the PlasmoidItem `onClick`
takes precedence and systray collapsing works.
FIXED-IN: 5.24


(cherry picked from commit a321bbcefee7d221fc2fd52a569bdb8740b9dd0b)

M  +4    -3    applets/systemtray/package/contents/ui/items/AbstractItem.qml

https://invent.kde.org/plasma/plasma-workspace/commit/1fcf3553ae2ff25a8404c82e76fc3e13d36cb650
Comment 8 ratijas 2022-02-04 23:52:17 UTC
Apparently, not completely fixed: desktop containment still suffers from a slightly different problem:
https://bugs.kde.org/show_bug.cgi?id=449633