Bug 488993 - "Close windows by double clicking the menu button" with custom window decorations also maximizes/minimizes window (and sometimes kills mouse input)
Summary: "Close windows by double clicking the menu button" with custom window decorat...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (other bugs)
Version First Reported In: 6.1.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-22 17:49 UTC by Edoardo Lolletti
Modified: 2024-06-28 13:06 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edoardo Lolletti 2024-06-22 17:49:36 UTC
STEPS TO REPRODUCE
1. Have the above option enabled with custom decorations
2. Double click on the menu button

OBSERVED RESULT
Kwin properly closes the window, but at the same time it also starts the maximize/minimize action (if enabled). On x11 is more evident, while on wayland it has a slightly similar but still broken behaviour.
During one of the tests, while trying to close this way a maximized window, it also happened that kwin just stopped registering mouse click events entirely.

EXPECTED RESULT
The double click action should behave exactly as if the window close button was pressed.

SOFTWARE/OS VERSIONS
KDE Plasma 6.1
Comment 1 Bug Janitor Service 2024-06-27 14:28:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6008
Comment 2 Vlad Zahorodnii 2024-06-28 12:47:00 UTC
Git commit a9377db1a903616f021fe5424a403600be25b545 by Vlad Zahorodnii.
Committed on 28/06/2024 at 12:38.
Pushed by vladz into branch 'master'.

plugins/kdecoration: Fix MenuButton not accepting button press events

If two mouse areas are stacked on top of each other and a button press
event is sent so one of them accepts it, QMouseEvent::isAccepted() will
still return false. It's a QtQuick bug, see the associated upstream bug
report https://bugreports.qt.io/browse/QTBUG-126733.

On the other hand, given that the MenuButton implements its own input
handling, we can port it away from DecorationButton to mitigate the issue.

M  +8    -4    src/plugins/kdecorations/aurorae/src/qml/MenuButton.qml

https://invent.kde.org/plasma/kwin/-/commit/a9377db1a903616f021fe5424a403600be25b545
Comment 3 Vlad Zahorodnii 2024-06-28 13:06:46 UTC
Git commit 176e338c370bcee12037b34ae5ffaf2d3bcb8ec8 by Vlad Zahorodnii.
Committed on 28/06/2024 at 12:49.
Pushed by vladz into branch 'Plasma/6.1'.

plugins/kdecoration: Fix MenuButton not accepting button press events

If two mouse areas are stacked on top of each other and a button press
event is sent so one of them accepts it, QMouseEvent::isAccepted() will
still return false. It's a QtQuick bug, see the associated upstream bug
report https://bugreports.qt.io/browse/QTBUG-126733.

On the other hand, given that the MenuButton implements its own input
handling, we can port it away from DecorationButton to mitigate the issue.


(cherry picked from commit a9377db1a903616f021fe5424a403600be25b545)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +8    -4    src/plugins/kdecorations/aurorae/src/qml/MenuButton.qml

https://invent.kde.org/plasma/kwin/-/commit/176e338c370bcee12037b34ae5ffaf2d3bcb8ec8