Bug 468417 - The "close" button in WindowHeap-based effects effect can also drag the window
Summary: The "close" button in WindowHeap-based effects effect can also drag the window
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-window-management (show other bugs)
Version: 5.27.4
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-12 08:32 UTC by Adam Fontenot
Modified: 2023-12-20 07:14 UTC (History)
1 user (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 Adam Fontenot 2023-04-12 08:32:15 UTC
SUMMARY

When viewing presented windows, and you click on the close button to close a window, if the cursor moves in between the mousedown and mouseup events, the window will be dragged instead of closed.

This results in a "failed" close attempt, similar in appearance to https://bugs.kde.org/show_bug.cgi?id=451150

STEPS TO REPRODUCE
1. Open present windows
2. Click and drag the close button by one or two pixels and then release it (while still over the close button).

OBSERVED RESULT
The window gets dragged in the present-windows view.

EXPECTED RESULT
The window is closed.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.10-arch1-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION

It's really easy to trigger this behavior on a trackpad, because your finger naturally remains on the trackpad while you are clicking, especially when trying to close many windows sequentially. I expect it is more annoying and harder to avoid the higher precision of the trackpad, and possibly the higher the display density.

This behavior also runs counter to normal button behavior. You can cancel an accidental mousedown on the window closing button ("X") by leaving the area of the button before releasing the mouse button, but the action is *not* canceled if you release the button while the cursor is still over the button area.

I have video of this behavior if for some reason it is hard to reproduce.
Comment 1 Adam Fontenot 2023-12-20 07:14:21 UTC
I tried to repro this under the Plasma 6 beta and partially failed. It seems that something was changed and now dragging a window in the present-windows view only starts dragging after you've moved the cursor ~5 pixels or so.

Assuming this was a deliberate decision (?!), it makes this bug hard to accidentally encounter. You *can* still drag the window via the close button, but this doesn't really happen by accident any more.

Closing, but I'll keep an eye on whether it's regressed.