Bug 428272 - Unmaximize does not restore window size/position correctly if KWin's Quicktile shortcuts were used before
Summary: Unmaximize does not restore window size/position correctly if KWin's Quicktil...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.22.5
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
: 475063 (view as bug list)
Depends on: 325566
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-26 14:00 UTC by cyslider
Modified: 2024-10-26 16:11 UTC (History)
15 users (show)

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


Attachments
Video of "resize" workaround (3.69 MB, video/webm)
2024-02-13 13:59 UTC, Yevhen Popok
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cyslider 2020-10-26 14:00:03 UTC
SUMMARY

If I use shortcuts to tile a window, for example into a corner of the screen. Then maximize and unmaximize it, it does not restore into the corner but instead into the last manually adjusted position/size.

STEPS TO REPRODUCE
1. Open a window
2. move it into the center of the screen
3. Move it into the right using a keyboard shortcut Meta+right
4. Maximize it by double clicking the title bar
5. Undo maximizing by double clicking the title bar again 

OBSERVED RESULT

Window is back in the center

EXPECTED RESULT

Window should be at the right side

Operating System: Manjaro Linux
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Kernel Version: 5.4.67-1-MANJARO
OS Type: 64-bit
Processors: 16 × AMD Ryzen 7 1800X Eight-Core Processor
Memory: 62,8 GiB of RAM
Graphics Processor: Radeon RX 580 Series

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2020-10-26 18:34:16 UTC
Yes, this is a minor bug. Un-maximizing returns to the last state that was neither maximized nor tiled, rather than returning to the prior state, whatever that is.
Comment 2 cyslider 2020-10-26 22:55:20 UTC
I hope "minor" here means easy to fix, not unimportant. As you normally use Quick tile shortcuts if you have the need to organize your windows and this kinda throws a big wrench into archiving this objective.
Comment 3 Vlad Zahorodnii 2020-10-28 20:12:53 UTC
Code-wise, this is totally intended behavior.
Comment 4 Sebastian 2021-10-28 07:37:56 UTC
Any update on that bug? I absolutely second cysliders justification, this bug really messes up KDE shortcut based workflows. 
Not sure what is meant by "totally intended behavior", could you elaborate on this?
Comment 5 Nate Graham 2021-10-28 16:40:54 UTC
He means that from a developer perspective, this isn't a bug but rather intentional behavior. Someone programmed the feature to work this way.

From your (and my) perspective it is a bug, though. Intended behaviors that are annoying can be changed.
Comment 6 Sebastian 2021-10-29 07:35:24 UTC
Got it, thanks for the heads-up. I was afraid this was the case and consider this a bug as well since I couldn't thing of a single use case where this behaviour would make sense. The title of this says it already, it's an inconsistent and intuitive behaviors, the user needs to keep track if he used a quicktile shortcut to know what's gonna happen when restore window size. Who wants to do that!? 
 
Maybe whoever made this decision could explain any use-cases? Happy to be persuaded. 
However, at the very least there should be an option to change this behavior, i.e. treat quicktile shortcuts the same as manual resizing.
Comment 7 mail.orb 2021-11-12 08:58:49 UTC
This current behaviour makes it hard to use tiling, because you can not maximize/unmaximize a window, without getting a floating window again.
Comment 8 Nate Graham 2023-10-12 19:00:45 UTC
*** Bug 475063 has been marked as a duplicate of this bug. ***
Comment 9 Yevhen Popok 2024-02-13 13:59:39 UTC
Created attachment 165806 [details]
Video of "resize" workaround

For now I'm using "Resize Window" shortcut/action as a workaround.

Caveats:
- Tested on KDE Plasma 6.0 RC2 and 1920x1080 display resolution
- It works mostly for bigger tiles (e.g. 2 windows tiled vertically in half)
- This trick breaks simultaneous resizing of tiled windows (that was introduced in Plasma 5.27)

How to (also see attached screencast):
1. Assign some shortcut (e.g.  Meta+Ctrl+s) for "Resize Window". it can be set at "System Settings" > "Keyboard" > "Shortcuts" > "KWin")
You can also assign something like Meta+Ctrl+w for "Move Window" action
2. Tile windows and adjust their sizes
3. Use keyboard only (don't use mouse or touchpad) for the next steps
4. After switching to the tiled window,  press "Resize Window" shortcut (if it wasn't set, press Alt+F3 to activate window menu, and use keyboard arrows to find and activate "Resize" window action).
5. The cursor will move automatically to the lower right corner of the window, ready for resize
6. Don't resize window, just "Enter" or "Space" to confirm.
7.  Use "Move"/"Move Window" window action or shortcut for a test. After "Move window" activation,  window will either move temporally to different location or stay in place. Either way, you can restore previous ("tiled") window location by pressing "Esc" key. If window temporally changes location during "Move Window" activation, then this "resize" workaround wouldn't help, and after "Maximize"/"Unmaximize" window will be moved to the inappropriate location.
Comment 10 s.gicic 2024-05-08 14:49:41 UTC
I also see similar behaviour with the tile layout (Super+t). When a tiled window, that has been assigned to a tile while shift-dragging gets maximized and subsequently unmaximized, it does not return to its previously assigned tile. Could be just intended behaviour, but at least for me it should always return to where it previously was, be it assigned to a tile or a manually resized/dragged floating window.

Important to note: A floating window that was manually resized and dragged to its place does return to the correct location/size upon unmaximisation.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

KWin Support Information:
The following information should be used when requesting support on e.g. https://discuss.kde.org.
It provides information about the currently running instance, which options are used,
what OpenGL driver and which effects are running.
Please post the information provided underneath this introductory text to a paste bin service
like https://paste.kde.org instead of pasting into support threads.

==========================

Version
=======
KWin version: 6.0.4
Qt Version: 6.7.0
Qt compile version: 6.7.0
XCB compile version: 1.17.0

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_GLX: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12101013
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

Decoration
==========
Plugin: org.kde.breeze
Theme: 
Plugin recommends border size: None
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 0
gridUnit: 10
font: Noto Sans,10,-1,0,400,0,0,0,0,0,0,0,0,0,0,1
smallSpacing: 2
largeSpacing: 10

Output backend
==============
Name: KWin::X11StandaloneBackend

Cursor
======
themeName: breeze_cursors
themeSize: 24

Options
=======
focusPolicy: ClickToFocus
xwaylandCrashPolicy: 1
xwaylandMaxCrashCount: 3
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
activeMouseScreen: true
placement: 5
activationDesktopPolicy: SwitchToOtherDesktop
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: false
focusStealingPreventionLevel: 1
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: MouseRaise
commandActiveTitlebar2: MouseNothing
commandActiveTitlebar3: MouseOperationsMenu
commandInactiveTitlebar1: MouseActivateAndRaise
commandInactiveTitlebar2: MouseNothing
commandInactiveTitlebar3: MouseOperationsMenu
commandWindow1: MouseActivateRaiseAndPassClick
commandWindow2: MouseActivateAndPassClick
commandWindow3: MouseActivateAndPassClick
commandWindowWheel: MouseNothing
commandAll1: MouseUnrestrictedMove
commandAll2: MouseToggleRaiseAndLower
commandAll3: MouseUnrestrictedResize
keyCmdAllModKey: 16777250
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 2
glStrictBinding: false
glStrictBindingFollowsDriver: true
glPreferBufferSwap: AutoSwapStrategy
glPlatformInterface: 1
windowsBlockCompositing: true
allowTearing: true

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

Screens
=======
Active screen follows mouse:  yes
Number of Screens: 1

Screen 0:
---------
Name: DP-0
Enabled: 1
Geometry: 0,0,3440x1440
Scale: 1
Refresh Rate: 59972
Adaptive Sync: incapable

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1080/PCIe/SSE2
OpenGL version string: 3.1.0 NVIDIA 550.78
OpenGL platform interface: GLX
OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
Driver: NVIDIA
Driver version: 550.78
GPU class: Unknown
OpenGL version: 3.1
GLSL version: 1.40
X server version: 1.21.1
Linux kernel version: 6.6.30
Direct rendering: Requires strict binding: no
Virtual Machine:  no
OpenGL 2 Shaders are used

Loaded Effects:
---------------
screenshot
outputlocator
colorpicker
screenedge
blur
contrast
sessionquit
logout
login
slidingpopups
windowaperture
slide
squash
scale
morphingpopups
maximize
fullscreen
frozenapp
fadingpopups
dialogparent
windowview
tileseditor
overview
highlightwindow
blendchanges
startupfeedback
kscreen

Currently Active Effects:
-------------------------
screenedge
blur
contrast

Effect Settings:
----------------
screenshot:

outputlocator:

colorpicker:

screenedge:

blur:

contrast:

sessionquit:
pluginId: sessionquit
isActiveFullScreenEffect: false

logout:
pluginId: logout
isActiveFullScreenEffect: false

login:
pluginId: login
isActiveFullScreenEffect: false

slidingpopups:
slideInDuration: 150
slideOutDuration: 250

windowaperture:
pluginId: windowaperture
isActiveFullScreenEffect: false

slide:
horizontalGap: 45
verticalGap: 20
slideBackground: true

squash:
pluginId: squash
isActiveFullScreenEffect: false

scale:
pluginId: scale
isActiveFullScreenEffect: false

morphingpopups:
pluginId: morphingpopups
isActiveFullScreenEffect: false

maximize:
pluginId: maximize
isActiveFullScreenEffect: false

fullscreen:
pluginId: fullscreen
isActiveFullScreenEffect: false

frozenapp:
pluginId: frozenapp
isActiveFullScreenEffect: false

fadingpopups:
pluginId: fadingpopups
isActiveFullScreenEffect: false

dialogparent:
pluginId: dialogparent
isActiveFullScreenEffect: false

windowview:
activeView: 
delegate: 
animationDuration: 300
layout: 1
ignoreMinimized: false
mode: 
partialActivationFactor: 0
gestureInProgress: false
searchText: 
selectedIds: 

tileseditor:
activeView: 
delegate: 
animationDuration: 200

overview:
activeView: 
delegate: 
animationDuration: 300
layout: 1
ignoreMinimized: false
filterWindows: true
organizedGrid: true
overviewPartialActivationFactor: 0
overviewGestureInProgress: false
transitionPartialActivationFactor: 0
transitionGestureInProgress: false
gridPartialActivationFactor: 0
gridGestureInProgress: false
desktopOffset: 
searchText: 

highlightwindow:

blendchanges:

startupfeedback:
type: 1

kscreen:


Loaded Plugins:
---------------
krunnerintegration
nightcolor

Available Plugins:
------------------
BounceKeysPlugin
StickyKeysPlugin
buttonsrebind
krunnerintegration
nightcolor
screencast