Bug 382313 - Quick Tile to the Top twice moves window to another screen
Summary: Quick Tile to the Top twice moves window to another screen
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: 5.10.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D6708
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-13 18:57 UTC by t.soernes
Modified: 2017-07-17 14:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.10.4
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: X11+


Attachments
quick tile bottom (244.30 KB, image/png)
2017-07-14 04:38 UTC, t.soernes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description t.soernes 2017-07-13 18:57:36 UTC
Quick tiling a window to the top maximizes the window AND moves it to a different screen. If the window covers the top half of the screen, then one quick tile top action moves it to a another screen. If the window is in any other state then two such actions produce the same behavior. Plasma 5.10.1, Fedora 26, Xorg. Happens on two different machines with same OS but Intel Integrated graphics and Nvidia blob drivers respectively.
Comment 1 t.soernes 2017-07-13 20:49:22 UTC
Furthermore, quick tiling to the bottom three times (from maximized window) also produces this behavior. In my opinion, doing 'Quick Tile to the Bottom' on a window that covers the bottom half of the screen should certainly should maximize the window; if anything it should minimize it or do nothing.
Comment 2 Martin Flöser 2017-07-14 04:05:44 UTC
We don't have a quick tile to bottom
Comment 3 t.soernes 2017-07-14 04:38:20 UTC
Created attachment 106601 [details]
quick tile bottom
Comment 4 Martin Flöser 2017-07-14 20:37:03 UTC
Oh the global shortcut. I thought you meant quick tile when moving the window
Comment 5 Martin Flöser 2017-07-15 05:35:56 UTC
I'm sorry, but what you consider a bug is the expected behavior. I just checked the code and found the following comment:

        // If trying to tile to the side that the window is already tiled to move the window to the next
        // screen if it exists, otherwise toggle the mode (set QuickTileNone)

see https://cgit.kde.org/kwin.git/tree/geometry.cpp?h=Plasma%2F5.10#n3351
Comment 6 Martin Flöser 2017-07-15 06:29:29 UTC
I just started to add a unit test for the behavior (as that was not yet covered) and there is something fishy.
Comment 7 Martin Flöser 2017-07-15 06:55:20 UTC
For top and bottom the expected behavior should have been just moving it to the other screen and keeping the state. This had a bug.
Comment 8 Martin Flöser 2017-07-15 07:01:21 UTC
Patch at: https://phabricator.kde.org/D6708
Comment 9 t.soernes 2017-07-15 23:35:00 UTC
The code you quoted is only supposed move a left-tiled window to the monitor to the left if called with a QuickTileLeft action. Similarly for right, but not top or bottom hence line 3366 ("continue; // not in horizontal line"). This could be extended to support vertical monitor setups (one atop of another) but that's not what I have and that's not what the code is currently supposed to do as far as I can tell. It should only move to another screen if there's a screen in the direction of the quicktile action, at least that's what I can glean from the code but more importantly that would be the most sensible behavior. I haven't tested your patch; perhaps what I mentioned is what you fixed.
Comment 10 Martin Flöser 2017-07-16 13:26:54 UTC
No, what I fixed is differently. When going from top to top, the top was removed and replaced by right and left, which doesn't make sense because a window cannot be right and left at the same time. This is the maximized you experienced.

I fixed the code to keep it at top, but still move to the next screen. It's a bug fix, I tried to make it not invasive. The more proper solution would be to add the vertical support as you suggest, but that would be a new feature.
Comment 11 Martin Flöser 2017-07-17 14:52:40 UTC
Git commit 139b4dc82a9423e42285a469ab7f7cc4139d7054 by Martin Flöser.
Committed on 17/07/2017 at 14:51.
Pushed by graesslin into branch 'Plasma/5.10'.

Properly swap the quick tile side when pressing the shortcut again

Summary:
The quick tile shortcuts have a feature of moving the window to the next
screen if one presses the same shortcut again.
E.g. if a window is quick tiled to the left on the right most screen,
quick tile again to left should move it to the left screen and quick tile
right. Thus it swaps the borders.

This wasn't handled correctly, especially not for modes like top and
bottom. If a window is quick tiled to the top an impossible mode was
generated: Left | Right. Doesn't make sense.

This change fixes the mode swapping and extends our quick tile testing
to cover the situation.
FIXED-IN: 5.10.4

Test Plan: Extended test case

Reviewers: #plasma, #kwin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6708

M  +32   -18   autotests/integration/quick_tiling_test.cpp
M  +3    -1    geometry.cpp

https://commits.kde.org/kwin/139b4dc82a9423e42285a469ab7f7cc4139d7054