Bug 481610 - Dragging a window along the top screen edge makes it follow the mouse by 1 pixel increments
Summary: Dragging a window along the top screen edge makes it follow the mouse by 1 pi...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.93.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
: 483927 490209 500757 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-02-21 05:09 UTC by Mikhail Sidorov
Modified: 2025-03-07 16:32 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.3.3
Sentry Crash Report:


Attachments
dragging a window against the top screen edge (2.47 MB, video/webm)
2024-02-21 05:09 UTC, Mikhail Sidorov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Sidorov 2024-02-21 05:09:11 UTC
Created attachment 165969 [details]
dragging a window against the top screen edge

STEPS TO REPRODUCE
1. Grab a window by its titlebar
2. Drag the window to the top edge of the screen so that it goes over the edge partially

OBSERVED RESULT
The window starts lagging behind the mouse cursor, only shifting in the direction of the cursor by 1 pixel increments any time the mouse is moved (see the attached video).

EXPECTED RESULT
The window keeps following the mouse, staying "attached" to the cursor.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.5-zen1-1-zen (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

Dragging the window with Meta + Left Click seems to be working fine, not exhibiting the bug.

Things I've tried which did not change the behavior:
- disabling "Mouse & Touchpad / Screen Edges / Maximize: Windows dragged to the top edge"
- disabling "Window Management / Window Behavior / Movement / Screen edge snap zone"
Comment 1 Zamundaaa 2024-02-21 15:50:41 UTC
Can confirm
Comment 2 Doug 2024-02-22 06:38:06 UTC
I would think that it shouldn't matter as when you release your drag the window will be maximized.
Comment 3 Nate Graham 2024-02-22 16:58:26 UTC
Right it's not really a *problem*, just a bit odd. Hence the "minor" severity.
Comment 4 Bug Janitor Service 2024-02-25 00:32:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5296
Comment 5 fanzhuyifan 2024-03-18 23:22:58 UTC
*** Bug 483927 has been marked as a duplicate of this bug. ***
Comment 6 fanzhuyifan 2024-03-18 23:50:14 UTC
Git commit 9fabb7b938089a47308813fe8dc70d77e38ee938 by Yifan Zhu.
Committed on 18/03/2024 at 23:46.
Pushed by fanzhuyifan into branch 'drag-top'.

window: fix interactiveMove exit condition

Previously the <= 1.0 test always succeeds in the first try, causing the
loop to exit prematurely.

M  +4    -4    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/9fabb7b938089a47308813fe8dc70d77e38ee938
Comment 7 fanzhuyifan 2024-03-19 03:41:09 UTC
Git commit 701f9140816477d1b8e2618cd72e8c1d02c3df6b by Yifan Zhu.
Committed on 19/03/2024 at 03:33.
Pushed by fanzhuyifan into branch 'master'.

window: fix interactiveMove exit condition

Previously the <= 1.0 test always succeeds in the first try, causing the
loop to exit prematurely.

M  +4    -4    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/701f9140816477d1b8e2618cd72e8c1d02c3df6b
Comment 8 fanzhuyifan 2024-03-19 10:16:05 UTC
Git commit 90e070d004ef57f2ec5acb3f1dd3807e3d1a038f by Yifan Zhu.
Committed on 19/03/2024 at 03:44.
Pushed by vladz into branch 'Plasma/6.0'.

window: fix interactiveMove exit condition

Previously the <= 1.0 test always succeeds in the first try, causing the
loop to exit prematurely.
(cherry picked from commit 701f9140816477d1b8e2618cd72e8c1d02c3df6b)

M  +4    -4    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/90e070d004ef57f2ec5acb3f1dd3807e3d1a038f
Comment 9 fanzhuyifan 2024-03-21 14:59:18 UTC
Can still sometimes reproduce, reopening.
Comment 10 fanzhuyifan 2024-08-02 18:12:14 UTC
*** Bug 490209 has been marked as a duplicate of this bug. ***
Comment 11 fanzhuyifan 2025-02-24 17:53:30 UTC
Git commit 76516a10c0230e0bc5d3fc65e3998425075a6cda by Yifan Zhu.
Committed on 24/02/2025 at 17:36.
Pushed by fanzhuyifan into branch 'master'.

window: reimplement restriction in moveResize

In restricted moveResize, try to guarantee at least a 100px contiguous
block of the titlebar is visible. Previously this was implemented by
shifting the geometry by 1px increments, trying to find a suitable
position. This is inefficient and error-prone.

Replace this with an efficient algorithm that finds the closest
candidate position. Consolidate the restriction code and add tests.
Related: bug 401271, bug 493797

M  +396  -1    autotests/integration/move_resize_window_test.cpp
M  +3    -3    autotests/integration/x11_window_test.cpp
A  +-    --    doc/moveresizerestriction/moveresizerestriction.pdf
A  +232  -0    doc/moveresizerestriction/moveresizerestriction.tex
M  +266  -172  src/window.cpp
M  +1    -1    src/window.h

https://invent.kde.org/plasma/kwin/-/commit/76516a10c0230e0bc5d3fc65e3998425075a6cda
Comment 12 fanzhuyifan 2025-02-26 03:06:14 UTC
*** Bug 500757 has been marked as a duplicate of this bug. ***
Comment 13 Vlad Zahorodnii 2025-03-06 23:01:48 UTC
Git commit cb0e06d2900add3387e235a62f94cbfb914d0deb by Vlad Zahorodnii, on behalf of Yifan Zhu.
Committed on 06/03/2025 at 22:09.
Pushed by vladz into branch 'Plasma/6.3'.

window: reimplement restriction in moveResize

In restricted moveResize, try to guarantee at least a 100px contiguous
block of the titlebar is visible. Previously this was implemented by
shifting the geometry by 1px increments, trying to find a suitable
position. This is inefficient and error-prone.

Replace this with an efficient algorithm that finds the closest
candidate position. Consolidate the restriction code and add tests.
Related: bug 401271, bug 493797
(cherry picked from commit 76516a10c0230e0bc5d3fc65e3998425075a6cda)

M  +396  -1    autotests/integration/move_resize_window_test.cpp
M  +3    -3    autotests/integration/x11_window_test.cpp
A  +-    --    doc/moveresizerestriction/moveresizerestriction.pdf
A  +232  -0    doc/moveresizerestriction/moveresizerestriction.tex
M  +266  -172  src/window.cpp
M  +1    -1    src/window.h

https://invent.kde.org/plasma/kwin/-/commit/cb0e06d2900add3387e235a62f94cbfb914d0deb