Bug 491152 - Windows should not snap to window edges that are currently invisible
Summary: Windows should not snap to window edges that are currently invisible
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 6.1.3
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2024-08-02 05:45 UTC by Adam Fontenot
Modified: 2024-08-05 18:21 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 Adam Fontenot 2024-08-02 05:45:18 UTC
Whenever I have a bunch of windows open, let's say 15+, trying to drag a window around is a snapping nightmare where the window is constantly getting attached to window edges that are buried 10 layers deep, e.g. under a maximized browser window. Window snapping is crucial, I don't want to disable it, but this is a real pain.

Sometimes, the bad snaps can interfere with the snap you *want*, making it difficult or impossible to rearrange your windows. 

This is ultimately a feature request, but I think it's a pretty obvious one and I was surprised that I couldn't find an issue already reported for it.

SUMMARY


STEPS TO REPRODUCE
1. Open a ton of randomly placed small windows. 20 KWrite windows launched from a terminal is a good way to test this.
2. Open a maximized window above all the other windows.
3. Move a non-maximized window around on top of the maximized window, and observe the snapping behavior.

OBSERVED RESULT

Window gets snapped at random locations all over the place. The setting "Snap windows: Only when overlapping" doesn't affect this (in fact, I don't know what it does).

The issue feels more annoying as the resolution of your screen decreases, because the snapping margin doesn't scale with the screen resolution. On a QHD screen it's not too terrible, on FHD it's worse.

EXPECTED RESULT

Window does not get snapped anywhere, because there are no visible non-maximized windows to snap to.

Operating System: Arch Linux 
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.10.1-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

This is potentially a tough ask, because the ideal implementation would correctly deal with partially visible windows, and only snap if the *portion* of the window that abuts the currently being moved window is at least partially visible, regardless of whether other parts of the window are visible or not.

I think a reasonable starting point that is hopefully easy to implement would be to not ignore windows as snapping targets if they are entirely invisible. A slight step up from that might be to ignore window edges that are entirely invisible, if that could be implemented reasonably.