STEPS TO REPRODUCE 1. Run kolourpaint and maximize it vertically 2. Close kolourpaint 3. Start again kolourpaint. Height is equal to height of screen 4. Maximize it to full screen and unmaximize 5. Height of window is not equal to height of screen When changing vertical size (using mouse) equal to size of screen then after unmaximize size restored as expected. But when window initially vertically maximized then size after unmaximize is lost. OBSERVED RESULT After unmaximize size of window always should be same as before maximize. SOFTWARE/OS VERSIONS KDE Plasma Version: 5.24.4 KDE Frameworks Version: 5.93 Qt Version: 5.15.3
This happens even without restarting the app: - open dolphin, note the window size, maximize it vertically - maximize it (which affects both vertical and horizontal size) - un-maximize it, it goes back to the initial window size from step 1 Repeat the above but instead of maximizing vertically using kwin shorctus (e.g. middle clicking the maximize button on the title bar), resize the window manually to the same size it would have been changed to; everything works as expected.
*** Bug 423620 has been marked as a duplicate of this bug. ***
> But when window initially vertically maximized then size after unmaximize is lost when a window is started initially vertically maximized, kwin has no idea what size the window must have after unmaximizing, e.g. whether it should have the same size as the height of the work area or something else. Atm iirc it picks some small size.
(In reply to Vlad Zahorodnii from comment #3) > > But when window initially vertically maximized then size after unmaximize is lost > > when a window is started initially vertically maximized, kwin has no idea > what size the window must have after unmaximizing, e.g. whether it should > have the same size as the height of the work area or something else. Atm > iirc it picks some small size. Why kwin does not know previous size? Kwin remember it before maximize and restores it after unmaximize. It works for any size except when height equals to work area size. And further: If vertical size to stretch manually to whole work area using mouse then kwin restores it after unmaximize as expected(!). Restoring does not working, for some reason, only if window height initially equal to work area size. So: 1. When window height less than work area height kwin restores it after unmaximize - OK 2. When window height equal to work area height and height was changed manually by mouse kwin restores it after unmaximize - OK 3. When window height equal to work area height initially and height WAS NOT changed by mouse kwin does not restore it after unmaximize - FAIL It is real bug. And it is very annoying restore windows vertical size after unmaximize (using mouse) hundred times per day.
> Restoring does not working, for some reason, only if window height initially equal to work area size I already explained why it doesn't work. kwin has insufficient information to properly restore the window so it picks a size of its own.
> kwin has insufficient information to properly restore the window so it picks a size of its own. Kwin restores window size correctly if window was manually resized before maximize. So it HAS previous size information. Why it can't restore size without manually resizing?
If you manually resize the window, kwin will be aware of that new size. If a window is initially maximized, kwin has no idea what its previous size had been. kwin doesn't know the previous state of apps. Also, please stop reopening the bug report. Don't abuse the power changing bug report status!
So, can KWin, instead of setting the maximize-vertically property (or whatever it's called in XCB/X11 land) on the window, calculate that height and "resize" the window instead? (I am not talking about the app-started-maximized-vertically use-case, rather the one in my previous comment). Of course, it could well be that would cause other issues, e.g. moving the window from one screen to another with a different size, if the maximized-vertically property isn't set, it's going go keep the height... window management is tough. :)
(In reply to Vlad Zahorodnii from comment #7) > If you manually resize the window, kwin will be aware of that new size. If a > window is initially maximized, kwin has no idea what its previous size had > been. kwin doesn't know the previous state of apps. Kwin should be aware of window size when it initially created not only when it manually resized.