Bug 493607 - Unexpected quick tiling behavior
Summary: Unexpected quick tiling behavior
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: Quick Tiling (other bugs)
Version First Reported In: git master
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, regression
Depends on:
Blocks:
 
Reported: 2024-09-24 22:47 UTC by Natalie Clarius
Modified: 2024-12-06 20:53 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natalie Clarius 2024-09-24 22:47:41 UTC
SUMMARY
Since recently quick tiling shortcuts have been behaving unexpectedly, and some tiling steps no longer work.

STEPS TO REPRODUCE
0. Two adjacent monitors, window tiled to left half of left screen
1. Meta+right
2. Meta+right
3. Meta+right
4. Meta+right

OBSERVED RESULT
1. untiled on left half of left screen (weird)
2. tiled to right half of left screen (expected, though this should have been one step earlier)
3. tiled to left half of right screen (ditto)
4. untiled on left half of left screen (weird)

EXPECTED RESULT
1. tiled to right half of left screen
2. tiled to left half of right screen
3. tiled to right half of right screen
4. still tiled to right half of right screen, or maybe untiled

ADDITIONAL INFORMATION
In the above scenario, the right half of the right screen can never be reached.  
The same problem is present the other way round.
Comment 1 Natalie Clarius 2024-09-24 22:51:49 UTC
Commit cb86a084 seems relevant, though I haven't yet tested reverting it
Comment 2 Natalie Clarius 2024-09-24 23:03:49 UTC
The result of step 4 is more unexpected than that of step 1 because the window also jumps screens, in the opposite direction of the shortcut pressed.
Comment 3 Vlad Zahorodnii 2024-09-24 23:24:05 UTC
> 1. untiled on left half of left screen (weird)

If a window is already tiled left and you combine (in master/6.3, the semantics are slightly different) it with the opposite action, the result would be no tiling. It's different from 6.2, but I don't think it's weird and there's no definite "this is right" or "this is wrong" in this case.

Regarding the other point in this bug report, yes, we need to fix that.
Comment 4 Natalie Clarius 2024-09-24 23:43:37 UTC
Not sure what you mean by "the other point"; I think I raised three:  
1. Window getting untitled unintuitive (debatable)  
2. Window getting moved to screen in the opposite direction unintuitive (maybe again debatable but I find it hard to see how it could be expected)  
3. Not possible to tile window to the right, this is clearly a loss of previously working functionality imo
Comment 5 Vlad Zahorodnii 2024-09-24 23:46:41 UTC
> Not sure what you mean by "the other point"

"3. Not possible to tile window to the right"
Comment 6 Bug Janitor Service 2024-09-25 00:40:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6489
Comment 7 Jin Liu 2024-09-25 02:46:41 UTC
I think it's caused by the window being restored to its original position (before tiling) in the other screen.

We can fix it by "restoring" it to a new position in the current screen, or we can do https://invent.kde.org/plasma/kwin/-/merge_requests/6489 so we don't bother with "restoring" at all. IIRC Vlad said "restoring to a new screen" is messy (when discussing launching apps in their previous positions regarding screen layout change), so I'd somewhat prefer the latter.
Comment 8 Bug Janitor Service 2024-12-03 22:56:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6857
Comment 9 Vlad Zahorodnii 2024-12-04 17:07:48 UTC
Git commit 596ce0b3a08b2fd304b809d923ff21267e25dc65 by Vlad Zahorodnii.
Committed on 04/12/2024 at 16:42.
Pushed by vladz into branch 'master'.

Tweak quick tile shortcut combination algorithm

This attempts to provide a compromise between the old and the new quick
tiling behavior.

With the proposed changes, if a window is tiled so it occupies the left
half of the screen and Meta+Right is pressed, the window will occupy the
right half of the screen. Quarter tiled windows are tiled as before. If
the window is migrated to another screen, it won't be untiled.

M  +4    -4    autotests/integration/quick_tiling_test.cpp
M  +5    -0    src/effect/globals.h
M  +51   -34   src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/596ce0b3a08b2fd304b809d923ff21267e25dc65