Bug 376104 - Quick tile window to any screen edge or corner de-maximizes the window without tiling as a first action since plasma 5.9.0
Summary: Quick tile window to any screen edge or corner de-maximizes the window withou...
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.10.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
Keywords: usability
: 376155 376224 380005 380468 381824 384552 384745 385192 385904 (view as bug list)
Depends on:
Reported: 2017-02-06 16:03 UTC by Christian Muehlhaeuser
Modified: 2022-02-25 08:24 UTC (History)
18 users (show)

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

Proposed patch (4.12 KB, patch)
2017-11-22 20:06 UTC, Martin Flöser

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Muehlhaeuser 2017-02-06 16:03:21 UTC
Trying to move a window to the left border of my leftest monitor sometimes sends the window to the wrong place, e.g. to the top right corner of that monitor - even tho the preview indicates it would snap into the right place.

On second try it usually works fine.
Comment 1 Martin Flöser 2017-02-06 18:42:24 UTC
Please provide the output of:
qdbus org.kde.KWin /KWin supportInformation
Comment 2 Christian Muehlhaeuser 2017-02-06 19:58:31 UTC
KWin version: 5.9.0
Qt Version: 5.8.0
Qt compile version: 5.8.0
XCB compile version: 1.12

Operation Mode: X11 only

Build Options
HAVE_X11_XCB: yes

Vendor: The X.Org Foundation
Vendor Release: 11901000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11                                                                                                                                                            
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Plugin: org.kde.breeze
Blur: 0
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 1, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Noto Sans,10,-1,5,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: true
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 2
windowSnapZone: 2
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 1
legacyFullscreenSupport: false
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: false
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 1
glSmoothScale: 2
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: true
glStrictBindingFollowsDriver: true
glCoreProfile: true
glPreferBufferSwap: 101
glPlatformInterface: 1
windowsBlockCompositing: true

Screen Edges
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 3

Screen 0:
Name: DisplayPort-0
Geometry: 0,0,3840x2160
Refresh Rate: 59.9966

Screen 1:
Name: HDMI-0
Geometry: 5760,856,1920x1080
Refresh Rate: 60

Screen 2:
Name: DVI-1
Geometry: 3840,856,1920x1080
Refresh Rate: 60

Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD CAPE VERDE (DRM 2.48.0 / 4.9.6-1-ARCH, LLVM 3.9.1)
OpenGL version string: 4.3 (Core Profile) Mesa 13.0.4
OpenGL platform interface: GLX
OpenGL shading language version string: 4.30
Driver: Unknown
GPU class: Unknown
OpenGL version: 4.3
GLSL version: 4.30
Mesa version: 13.0.4
X server version: 1.19.1
Linux kernel version: 4.9.6
Direct rendering: Requires strict binding: yes
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used
Painting blocks for vertical retrace:  no

Loaded Effects:

Currently Active Effects:

Effect Settings:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
enableFocusTracking: false
followFocus: true
focusDelay: 350
moveFactor: 20
targetZoom: 1

fadeInTime: 150
fadeOutTime: 250







zoomDuration: 300
border: 10
desktopNameAlignment: 0
layoutMode: 0
customLayoutRows: 2
usePresentWindows: true





layoutMode: 0
showCaptions: false
showIcons: false
doNotCloseWindows: true
ignoreMinimized: false
accuracy: 20
fillGaps: true
fadeDuration: 150
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 0
leftButtonDesktop: 2
middleButtonDesktop: 0
rightButtonDesktop: 0



blurRadius: 12
cacheTexture: true


type: 1


Comment 3 Martin Flöser 2017-02-06 20:12:35 UTC
Any chance to test with Qt 5.7? We have regressions in Qt 5.8 in other areas and I consider it as highly unlikely that our code broken given that quick tiling is completely under test coverage (at least the Wayland part and X11 didn't change).
Comment 4 Christian Muehlhaeuser 2017-02-07 13:59:22 UTC
Understood, but I'm afraid I won't be able to do this anytime soon.
Comment 5 Martin Flöser 2017-02-10 08:26:15 UTC
Are the windows you are trying to quick tile maximized vertically or horizontally? If yes this could be bug #376224
Comment 6 Christian Muehlhaeuser 2017-02-10 10:34:26 UTC
Not sure whether you mean before or after tiling, so to clarify: I'm trying to tile a non-maximized window to the left border of my screen (so it would become vertically maximized).
Comment 7 Martin Flöser 2017-02-10 13:24:14 UTC
non-maximized as in free floating or maybe touching some edges? We have a vertical maximized state which is not the quick tiling
Comment 8 Christian Muehlhaeuser 2017-02-10 14:30:22 UTC
Usually close to a screen corner, but certainly nowhere near touching it (at least 16px margin).
Comment 9 Christian Muehlhaeuser 2017-06-13 13:34:18 UTC
Confirmed as still existing with Qt 5.9.
Comment 10 Francis Herne 2017-07-17 14:27:39 UTC
Still present with KWin 5.10.3 and Qt 5.9.1

More-detailed repro steps:

1) Open a Konsole window.

This matters. With many (all?) KDE applications, and some others, this bug occurs. With urxvt or claws-mail, it doesn't.

2) Drag it to the middle-right edge of the screen, so it snaps to the right half.

3) Close the window.

4) Open a new Konsole window.

5) Drag /that/ to the middle-right edge again.

Observe that it snaps to a different area, usually one of the left corners.

With some non-KDE apps (Chromium, qutebrowser) it snaps to the top-right corner instead.
Comment 11 Martin Flöser 2017-07-22 15:15:05 UTC
*** Bug 376155 has been marked as a duplicate of this bug. ***
Comment 12 Martin Flöser 2017-09-10 14:30:09 UTC
*** Bug 384552 has been marked as a duplicate of this bug. ***
Comment 13 Martin Flöser 2017-09-15 16:26:08 UTC
*** Bug 384745 has been marked as a duplicate of this bug. ***
Comment 14 Martin Flöser 2017-09-29 14:27:28 UTC
*** Bug 385192 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2017-09-29 14:57:10 UTC
*** Bug 376224 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2017-09-29 14:57:19 UTC
*** Bug 380005 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2017-09-29 14:57:43 UTC
*** Bug 380468 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2017-09-29 14:57:56 UTC
*** Bug 381824 has been marked as a duplicate of this bug. ***
Comment 19 Nate Graham 2017-09-29 15:53:23 UTC
Migrating info from duped bugs:

This seems to have been caused by https://cgit.kde.org/kwin.git/commit/?id=9934f5b57537feae54afd0c4366c90253638ada2

The following quick-and-dirty patch seems to resolve it for some people:

--- a/geometry.cpp      2017-03-21 21:54:36.000000000 +0800
+++ b/geometry.cpp      2017-03-23 19:11:02.872123167 +0800
@@ -3326,6 +3326,8 @@
         TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry|TabGroup::Maximized);
+        setMaximize(false, false);
         if (mode != QuickTileNone) {
             m_quickTileMode = mode;
             // decorations may turn off some borders when tiled
@@ -3336,8 +3338,6 @@
         // Store the mode change
         m_quickTileMode = mode;
-        setMaximize(false, false);
         emit quickTileModeChanged();

Martin, since we do have test cases for X11 now, is this something we can get submitted to Phabricator as a patch?
Comment 20 Martin Flöser 2017-10-01 19:59:20 UTC
(In reply to Nate Graham from comment #19)
> Martin, since we do have test cases for X11 now, is this something we can
> get submitted to Phabricator as a patch?

No as it does not address the reasons on why the code was moved in first place. Just reverting a commit does not fix things, it causes issues in other places.
Comment 21 Antoscha 2017-10-12 12:43:33 UTC
(In reply to Nate Graham from comment #19) 
--- kwin-5.11.0/geometry.cpp	2017-10-12 15:13:48.467815000 +0300
+++ kwin-5.11.0/geometry.cpp	2017-10-12 15:13:34.340537140 +0300
@@ -3355,6 +3355,8 @@
     if (maximizeMode() != MaximizeRestore) {
         TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry|TabGroup::Maximized);
+        setMaximize(false, false);
         if (mode != QuickTileMode(QuickTileFlag::None)) {
             m_quickTileMode = mode;

This patch fixes the issue in 5.11.0. Tested in Archlinux.
Comment 22 Michael D 2017-10-12 13:02:01 UTC
The bug I originally reported, https://bugs.kde.org/show_bug.cgi?id=376224, marked as a duplicate of this one, isn't solved in 5.11.0 (KDE Neon). If I tile a vertically maximized window, instead of tiling it, it brings it back to its original (pre-maximized) dimensions.
Comment 23 Nate Graham 2017-10-12 13:05:52 UTC
Antoscha, it looks like that simple fix doesn't address Martin's concerns.
Comment 24 Martin Flöser 2017-10-12 15:15:04 UTC
The simple fix does not address the problem why the code changed like that in the first place. If we revert that part we just run into issues elsewhere in the code. We need a complete solution taking care of the required behavior on X11 and Wayland.
Comment 25 Martin Flöser 2017-10-18 15:33:41 UTC
*** Bug 385904 has been marked as a duplicate of this bug. ***
Comment 26 Andrew 2017-10-31 21:20:38 UTC
I have a similar issue with kwin 5.10.5 on Debian Testing Linux. I have quick tile shortcuts assigned to Meta+Up/Down/Left/Right and whenever I attempt to quick-tile a maximized window via shortcut, it de-maximizes before I am able to quick tile it. If I activate the shortcut a second time, the window tiles as expected.
Comment 27 Martin Flöser 2017-11-22 20:06:12 UTC
Created attachment 109016 [details]
Proposed patch

Attached is a patch built up on the suggestions we had so far. The suggestions didn't work, it broke existing test cases. This patch fixes the issue according to the tests and does not introduce regressions in other tests.

Please give it a try.
Comment 28 Till Schäfer 2017-11-23 11:02:54 UTC
I applied the patch here on kwin 5.11.3 running on xorg-server 1.19.5 and it works like a charm.
Comment 29 Martin Flöser 2017-12-04 17:31:27 UTC
Git commit 8a2796d280dd7e891724cb6e6d873a57e2ae8c52 by Martin Flöser.
Committed on 04/12/2017 at 16:25.
Pushed by graesslin into branch 'master'.

Fix regression from KWin 5.9 regarding quick tiling

The regression got introduced with 9934f5b57537feae54afd0c4366c90253638ada2.
The order when setMaximize(false, false) was called changed in regard to
when the quick tiling mode was adjusted. But just changing the ordering
back was no solution as that would cause regressions in other areas
(unit tests fail).

This change builds up on the support for geometry update blocker on
Wayland to be able to better support this situation without causing
further regressions.

Also this change rethinks the code area. There is an idea behind
temporarily setting the quick tile mode to none and that is even
documented in a comment: it should not confuse maximize. So let's do
exactly that: call the maximize in the block where the quick tile
mode is temporarily wrong. As that is only one branch the else branch
performs the same steps.
FIXED-IN: 5.12.0

Test Plan: Confirmation in bug report that patch fixes issue

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

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

M  +0    -16   autotests/integration/quick_tiling_test.cpp
M  +8    -5    geometry.cpp

Comment 30 Nicholas Serrano 2022-02-02 20:41:16 UTC
Currently using Fedora 35 and it seems this bugged behavior has returned at some point. Using a keybind to quick tile a currently maximized window causes the window to unmaximize but not tile as desired until a subsequent quick tile bind is pressed. Has anyone else run into this issue?
Comment 31 Nate Graham 2022-02-02 22:54:57 UTC
Can you please file a new bug report and put it in the "See also" field for this one?
Comment 32 Michael D 2022-02-03 07:43:07 UTC
Don't have this issue on Manjaro testing, plasma 5.23.5.
Comment 33 Michael D 2022-02-25 08:24:34 UTC
The bug's returned for me as well, at least on wayland, plasma 5.24.1. Was another report ever filed?