After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 385176 - nautilus should remember windows size even if it was maximized
nautilus should remember windows size even if it was maximized
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.16.x
Other All
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 427965 478603 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-12 20:00 UTC by Jan Niklas Hasse (Account disabled)
Modified: 2008-05-05 23:37 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Patch not to save geometry on close if window is maximized (1.28 KB, patch)
2007-06-30 16:41 UTC, Matteo Settenvini
none Details | Review
Updated patch to handle resizing better (2.94 KB, patch)
2007-06-30 17:44 UTC, Matteo Settenvini
none Details | Review
patch (1.65 KB, patch)
2008-04-16 17:51 UTC, Cosimo Cecchi
needs-work Details | Review
patch v2 (1.32 KB, patch)
2008-04-27 18:17 UTC, Cosimo Cecchi
committed Details | Review

Description Jan Niklas Hasse (Account disabled) 2006-12-12 20:00:57 UTC
Most of the time, i am using nautilus maximized but sometimes when i need to work with a couple of windows i need a small window. The problem is that nautilus has remember from last time that the window size is my screen size so that i have to resize it to a smaller size.

What nautilus should do: Save only the size when nautilus isn't maximized. If you close nautilus maximized it shouldn't change this value.

To reproduce:
- Open nautilus and size it to a nice value like 400x300.
- Maximize it
- (if you would restore it now everything works fine, it's again 400x300)
- Close nautilus
- Open nautilus (it opens maximized)
- Click the restore button (or whatever it is called in English)
- nautilus has your screen size and didn't saved the 400x300 size.

Other information:
Comment 1 Matteo Settenvini 2007-06-30 16:41:38 UTC
Created attachment 90933 [details] [review]
Patch not to save geometry on close if window is maximized

This is a quick patch that makes Nautilus remember the geometry value only if the window isn't maximized. I haven't tested it, just wrote it in 20 secs.

While this doesn't completely fix the issue (nautilus won't remember the last geometry if you first resize the window, then you maximize it and finally you close it), it offer a simple improvement upon the existing situation.

Another solution would be writing the geometry gconf key after every window resize event, and not on close. Checking if the window is maximized remains to be done on close. I can do that if you feel it's better. Just tell.
Comment 2 Matteo Settenvini 2007-06-30 17:44:42 UTC
Created attachment 90936 [details] [review]
Updated patch to handle resizing better

Although I ain't sure about performance (the user shouldn't continously resize the window, but who knows) I updated the patch as per my last comment. I also tried it on and it seems to work. :-)
Enjoy.
Comment 3 Cosimo Cecchi 2008-01-13 13:11:05 UTC
Hi Matteo and thanks for the patch! I am not a Nautilus maintainer, but I think you should avoid connecting to the "size-changed" signal to save the size.
It is better IMHO to connect to GtkWidget::window-state-event to track when the window is maximised and save its size before the maximization.
If you want and have time, could you please update the patch and send it for review to nautilus-list@gnome.org (it requires subscription for posting)? Patches on bugzilla are not reviewed usually.
Comment 4 Cosimo Cecchi 2008-04-16 13:17:45 UTC
*** Bug 427965 has been marked as a duplicate of this bug. ***
Comment 5 Cosimo Cecchi 2008-04-16 17:51:34 UTC
Created attachment 109378 [details] [review]
patch

Updated patch, works fine without connecting to any signal.
Comment 6 Christian Neumair 2008-04-27 17:59:54 UTC
Matteo, Cosimo: Thanks for working on that issue. This has been a real annoyance.

Cosimo: Regarding attachment 109378 [details] [review]:

I am very fine with the approach, but you shuffled around some code fragments which messes up revision history.

Maybe you could rewrite the patch to a two-liner?

You'd just have to initialize is_maximized in the "if (GTK_WIDGET(window)->window)" case, add a !is_maximized check before writing the geometry back and use is_maximized when writing back the WINDOW_MAXIMIZED boolean.
Comment 7 Cosimo Cecchi 2008-04-27 18:17:53 UTC
Created attachment 109999 [details] [review]
patch v2

Shorter patch, as for last comment from Christian.
Comment 8 Cosimo Cecchi 2008-04-27 18:18:26 UTC
Committed to trunk and gnome-2-22, closing as FIXED.

2008-04-27  Cosimo Cecchi  <cosimoc@gnome.org>

	* src/nautilus-navigation-window.c:
	(nautilus_navigation_window_save_geometry):
	Always properly remember window size, also in the case the window is
	closed being maximized. (#385176).
Comment 9 Cosimo Cecchi 2008-05-05 23:37:45 UTC
*** Bug 478603 has been marked as a duplicate of this bug. ***