Bug 401271 - Panel on second screen restricts movement on first
Summary: Panel on second screen restricts movement on first
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: 5.14.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 449160 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-21 11:51 UTC by Rokas Kupstys
Modified: 2025-03-07 16:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.3
Sentry Crash Report:
mgraesslin: X11+


Attachments
Video demonstrating the issue. (1.05 MB, video/mp4)
2018-11-21 11:51 UTC, Rokas Kupstys
Details
supportInformation (5.98 KB, text/plain)
2018-11-21 16:21 UTC, Rokas Kupstys
Details
monitor config (49.13 KB, image/png)
2018-11-21 16:28 UTC, Rokas Kupstys
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rokas Kupstys 2018-11-21 11:51:25 UTC
Created attachment 116442 [details]
Video demonstrating the issue.

Disabling snapzones does not prevent window snapping behavior.


STEPS TO REPRODUCE
1. Disable border/window/center snapzones in Window Behavior KCM on the "Move " tab.
2. Place window of any application at the center of the screen and move it towards the upper edge.

OBSERVED RESULT
Desktop attempts to snap window at about 1/4th of the distance from the top edge of the screen. Video attached.

EXPECTED RESULT
No snapping should happen.

SOFTWARE/OS VERSIONS
KDE Frameworks 5.52.0
Qt 5.11.2 (built against 5.11.2)
Comment 1 Rokas Kupstys 2018-11-21 14:44:27 UTC
Just noticed that this happens only on 1440p (main) screen. Secondary 1080p screen does not produce this behavior.
Comment 2 Martin Flöser 2018-11-21 16:07:50 UTC
Please provide the output of
qdbus org.kde.KWin /KWin supportInformation
Comment 3 Rokas Kupstys 2018-11-21 16:21:59 UTC
Created attachment 116450 [details]
supportInformation
Comment 4 Rokas Kupstys 2018-11-21 16:28:47 UTC
Created attachment 116451 [details]
monitor config

Just realized that this is related to monitor configuration. See image in what way monitors are configured. Window snaps at the position where edge of right monitor starts. If i move right monitor down - snapping position moves down as well.
Comment 5 Martin Flöser 2018-11-21 17:04:48 UTC
Could it be that you have a panel on the top of the right screen?
Comment 6 Rokas Kupstys 2018-11-21 17:05:15 UTC
I do.
Comment 7 Martin Flöser 2018-11-21 17:39:01 UTC
Try to top align your screens or remove that panel. I'm sure it will resolve the problem. Explanation will follow if you verify that my theory is correct.
Comment 8 Rokas Kupstys 2018-11-21 17:44:01 UTC
Both of suggested workarounds work indeed. It would still be nice to not have this behavior in my initial configuration. Monitors were aligned as they are in order to mimic their physical placement. 1080p monitor is an old thing whose height adjustment is implemented by a book on which it stands, so options of changing physical setup are quite limited. ;)
Comment 9 Martin Flöser 2018-11-21 18:22:21 UTC
To explain: panels have a so-called strut area. For historic reasons they extend over all screens. What you experience is not the snapping but a short delay before you can move the window over a "panel". By top aligning the screens the panels got aligned as well, so you don't face the problem any more.
Comment 10 Justin Zobel 2023-01-18 02:41:02 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 11 Rokas Kupstys 2023-01-31 07:06:47 UTC
This is still a problem.
Comment 12 Vlad Zahorodnii 2023-02-02 18:30:54 UTC
*** Bug 449160 has been marked as a duplicate of this bug. ***
Comment 13 fanzhuyifan 2024-08-02 18:23:02 UTC
I think this might be addressed by https://invent.kde.org/plasma/kwin/-/merge_requests/5296
Comment 14 fanzhuyifan 2025-02-24 17:53:46 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 481610, 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 15 Vlad Zahorodnii 2025-03-06 23:01:56 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 481610, 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