GNOME Bugzilla – Bug 385176
nautilus should remember windows size even if it was maximized
Last modified: 2008-05-05 23:37:45 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:
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.
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.
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.
*** Bug 427965 has been marked as a duplicate of this bug. ***
Created attachment 109378 [details] [review] patch Updated patch, works fine without connecting to any signal.
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.
Created attachment 109999 [details] [review] patch v2 Shorter patch, as for last comment from Christian.
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).
*** Bug 478603 has been marked as a duplicate of this bug. ***