Bug 290990 - Partial maximization state not reset unless "display borders on maximized windows" is checked
Summary: Partial maximization state not reset unless "display borders on maximized win...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 4.8.0
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-08 18:52 UTC by Jay LaCroix
Modified: 2012-01-13 15:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8


Attachments
Requested after_start file (29.25 KB, text/plain)
2012-01-08 20:59 UTC, Jay LaCroix
Details
Requested after_resize file (29.25 KB, text/plain)
2012-01-08 20:59 UTC, Jay LaCroix
Details
kwriterc (2.08 KB, application/octet-stream)
2012-01-08 21:00 UTC, Jay LaCroix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jay LaCroix 2012-01-08 18:52:04 UTC
Version:           4.8.0 (using Devel) 
OS:                Linux

I use the snap feature to dock applications to take up half of the screen (dragging a window to the edge and releasing). However, I notice that the applications will never save the window size again if I close the application before undocking it.

Reproducible: Always

Steps to Reproduce:
1.) Open an application, for example, Dolphin.

2.) Drag it to the right side of the screen, to make it snap to the right half of the desktop and release.

3.) Do not move the app away from being docked, leave it there. Close the application.

4.) Open the application again. Notice that it will open the same size it was when docked to the right side of the screen.

5.) Manually resize the application border to something sensible. 

6.) Close the application, and reopen it. Notice that it will now ALWAYS open the size of the entire half of the desktop.

Actual Results:  
The window permanently opens ever time to be the size of half of the desktop screen.

Expected Results:  
When I resize the application manually, it should remember it, and open that size next time. 

Right now I am having this issue with Dolphin, LibreOffice, and kwrite. Those three applications now open to an invalid window size each and every time I open them.
Comment 1 Thomas Lübking 2012-01-08 19:36:06 UTC
(In reply to comment #0)
> 4.) Open the application again. Notice that it will open the same size it was
> when docked to the right side of the screen.
Expectable.

> 6.) Close the application, and reopen it. Notice that it will now ALWAYS open
> the size of the entire half of the desktop.

It's not reproducable here but smells like the window gets vertically maximized (for dimensions) on the first restart and doesn't loose this state with being resized.

We'll ignore LibreOffice for the moment since I don't know how it stores it's size.

Please
a) ensure there is not instance of dolphin/kwrite etc. running (since you might encounter a race condition in the settings otherwise)
b) run your "broken" client (eg. kwrite)
c) from konsole run "xprop > after_start.txt" and click the kwrite window when the pointer turns into a cross
d) resize kwrite to whatever you consider "reasonable" ;-)
e) from konsole run "xprop > after_resize.txt" and click the kwrite window when the pointer turns into a cross
f) close kwrite
g) attach after_start.txt & after_resize.txt to this bug report as well as the kwrite config file (~/.kde/share/config/kwriterc) - you may strip a copy of the latter by the history and whatnot, only the geometry information ("Width 1920 = xyz", etc.) are relevant here
h) run "kcmshell4 kwinrules", ensure there's NO "remember" policy for the geometry of your affected clients and confirm that.
Comment 2 Jay LaCroix 2012-01-08 20:59:10 UTC
Created attachment 67594 [details]
Requested after_start file
Comment 3 Jay LaCroix 2012-01-08 20:59:30 UTC
Created attachment 67595 [details]
Requested after_resize file
Comment 4 Jay LaCroix 2012-01-08 21:00:52 UTC
Created attachment 67596 [details]
kwriterc
Comment 5 Jay LaCroix 2012-01-08 21:02:35 UTC
Thank you. I followed all of your instructions and attached the files. 

None of those applications were hiding in the background.

When I ran the last thing (kcmshell4 kwinrules) there was nothing there but "disable focus stealing prevention for xv".
Comment 6 Thomas Lübking 2012-01-08 21:21:53 UTC
Ok, the window doesn't get rid of the maximized vertical state on resizing if "display borders on maximized windows" is NOT checked (kcmshell4 kwinoptions, enabling it there will work around your issue)
Comment 7 Jay LaCroix 2012-01-09 17:18:09 UTC
On the first attempt, that option seems to work around the problem. The only other issue is that it still forgets the size the window was before I quick tiled it. My hope is that the window remembers the size it was before it is quick tiled, and then returns that property when closed while in the quick tiled state the same as it would return the property when pulled away from the quick tiled state. Is that possible? Or should I submit a wish item for that part?
Comment 8 Thomas Lübking 2012-01-09 17:38:25 UTC
the client stores the size it had when being closed. that's it.

technically we (the WW) could restore the former size (reset the tiling), but only if we know about the closing *before* it happens (that is, you use the titlebar button, not the menu "quit") what would make this behaviour not only a random side-effect (you might expect, others may not. should windows in general be unmaximized before closed?), but also an undeterministic one (from a users pov)

-> qualifies for a wish, not a bug at all (and no way this one. this one's a bug for sure ;-)
Comment 9 Jay LaCroix 2012-01-10 17:25:11 UTC
I would still like to submit a wish for that item. IMHO, when a window is quick tiled, it's size as being quick tiled should NOT be remembered, only the size beforehand should be remembered. If that's not possible, perhaps the size before being quick tiled can be stored in a variable and written to the config file on close. But maybe it would be easier to make the windows not remember the quick tiled size? I personally don't see the point in remembering that. With our competition, this is not an issue.
Comment 10 Thomas Lübking 2012-01-10 18:41:25 UTC
(In reply to comment #9)
> I would still like to submit a wish for that item.
You're absolutely free to do so. Sorry if it sounded any different, i just pointed out my concerns around such behavior and implementation.

In general the window itself has no idea whether it was quicktiled, vertically maximized or just resized to this dimensions - it just dumb-stores it's size when it closes.

So a hard technical limitation will *always* remain that the geometry can only be restored if the WM triggers the close event, not if the window tells the WM "ok, i just closed" since then it's too late and the window has already stored it's -from your pov- wrong size.
Comment 11 Jay LaCroix 2012-01-11 02:46:28 UTC
I noticed today that the problem appears worse. I dragged Konsole to the top of the screen to quick-maximize it. I then pulled it away from the top, but it didn't even try to return to it's original size. It stayed the same size as I dragged it away.
Comment 12 Thomas Lübking 2012-01-11 05:59:45 UTC
that is a known functional conflict between quick maximization and the "Show border" setting (which used to be called an provides "allow move/resize of maximized windows" - exists ever since the introduction of qm. it's unrelated to the original bug and to be adressed with a more general review of the feature. hopefully for 4.9
Comment 13 Thomas Lübking 2012-01-13 15:04:38 UTC
Git commit 5e8970617a9b501084a3925bbfc3740f9c42e715 by Thomas Lübking.
Committed on 12/01/2012 at 18:52.
Pushed by luebking into branch 'KDE/4.8'.

Withdraw partial maximization state when resizing partially maximized client but moveResizeMaximizedWindows() isn't true

REVIEW: 103683
FIXED-IN: 4.8

M  +1    -1    kwin/geometry.cpp

http://commits.kde.org/kde-workspace/5e8970617a9b501084a3925bbfc3740f9c42e715
Comment 14 Thomas Lübking 2012-01-13 15:43:22 UTC
Git commit 6ac777753481868a797a46d8f689e0f5fd435796 by Thomas Lübking.
Committed on 12/01/2012 at 18:52.
Pushed by luebking into branch 'master'.

Withdraw partial maximization state when resizing partially maximized client but moveResizeMaximizedWindows() isn't true

REVIEW: 103683
FIXED-IN: 4.8

M  +1    -1    kwin/geometry.cpp

http://commits.kde.org/kde-workspace/6ac777753481868a797a46d8f689e0f5fd435796