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 324097 - gnome-search-tool should remember last used window size/position
gnome-search-tool should remember last used window size/position
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: gsearchtool
2.12.x
Other Linux
: Low enhancement
: ---
Assigned To: gnome-utils Maintainers
gnome-utils Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-12-14 18:18 UTC by Jean-François Fortin Tam
Modified: 2005-12-21 02:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the proposed patch (8.98 KB, patch)
2005-12-20 00:17 UTC, Emmanuele Bassi (:ebassi)
needs-work Details | Review
Updated patch (10.04 KB, patch)
2005-12-20 06:13 UTC, Dennis Cranston
needs-work Details | Review
Proposed patch (12.45 KB, patch)
2005-12-20 07:38 UTC, Dennis Cranston
none Details | Review

Description Jean-François Fortin Tam 2005-12-14 18:18:51 UTC
Distribution/Version: ubuntu breezy badger

start gnome-search-tool, maximize it, close it and start it again. The
dimensions are not saved.
Comment 1 Dennis Cranston 2005-12-15 06:35:04 UTC
Usability people:  I would like some feedback.  Should gnome-search-tool
remember its previously displayed window size and/or location?  
Comment 2 Jean-François Fortin Tam 2005-12-15 13:27:27 UTC
As a HIG freak, I find it pretty strange that this was not raised earlier. If
the end user likes to have the maximum space to show his results everytime,
shouldn't the app remember that? I guess the location thing might be hard to do
because it was a hot metacity debate though. But I'm not sure about that
dimension thing either: I see that 99% of the gnome dialogs are reset to a
ridiculously tiny size, was that done by design or that was "left to the window
manager" or something?

I'm talking about the theme window, the wallpapers, the icon chooser, the file
chooser, the keyboard prefs, the sessions, all of those windows that usually
display a big list of content.
Comment 3 Dennis Cranston 2005-12-15 16:51:41 UTC
Regarding the default size of the preference windows, do not forget that these
windows need to fit on smaller displays (800x600 for example). 
Comment 4 Jean-François Fortin Tam 2005-12-15 22:32:12 UTC
I understand that, but I'm not criticizing the default size, just the lack of
"keeping the last user-specified size" ;) the default size can be small, no
problems with that. Just being able to remember the last one would be nice however.
Comment 5 Emmanuele Bassi (:ebassi) 2005-12-20 00:16:11 UTC
I have a small patch, adding a couple of keys to the schema, that (re)stores window size from gconf.
Comment 6 Emmanuele Bassi (:ebassi) 2005-12-20 00:17:22 UTC
Created attachment 56181 [details] [review]
the proposed patch

there's a minimal performance impact caused by gconf... I'm still working on this.
Comment 7 Dennis Cranston 2005-12-20 02:20:18 UTC
Thanks for the patch.  It's a good start.  Is there a way to know if the window is maximized?  Because if gnome-search-tool is maximized and then closed, when it is launched the again it will fill the entire screen but not be maximized.
Comment 8 Jean-François Fortin Tam 2005-12-20 02:29:35 UTC
Just asking, do you think this could be applied to other areas (when stable), such as the theme dialogs/background selector, etc? Or that's for another bug report ? Otherwise I could write down every app I belive would be "eligible" (usability-wise) to this change
Comment 9 Dennis Cranston 2005-12-20 05:41:50 UTC
I would recommend opening separate bugs for other modules.
Comment 10 Dennis Cranston 2005-12-20 06:13:27 UTC
Created attachment 56188 [details] [review]
Updated patch

This patch still has issues the maximized issue, but cleans up other issues in the previous patch.
Comment 11 Dennis Cranston 2005-12-20 07:38:29 UTC
Created attachment 56189 [details] [review]
Proposed patch

This patch addresses the maximized window issue.  It works for me, but can someone try it out?  Thanks.
Comment 12 Emmanuele Bassi (:ebassi) 2005-12-20 12:08:29 UTC
patch from comment #11 looks good.
Comment 13 Emmanuele Bassi (:ebassi) 2005-12-20 21:49:10 UTC
uhm, thinking better at it, we shouldn't use GConf to store state value, as GConf might be locked down.

we should use a session file inside $HOME/.gnome2, e.g. gnome-search-tool.session, where we store the last search and the window geometry; this would also come in handy for session re-start support.

the session file might look like this:

  [GSearchSession]
  LastQuery=*.txt
  WindowWidth=520
  WindowHeight=430

this could be read using GKeyFile upon start-up and wrote inside the destroy callback of the main window and the save-yourself/die callbacks of the GnomeClient object.

the functions for getting the stored settings would look like:

void
set_stored_query (const gchar *query);

const gchar *
get_stored_query (void);

void
set_stored_geometry (gint width, gint height);

void
get_stored_geometry (gint *width, gint *height);
Comment 14 Dennis Cranston 2005-12-21 02:02:56 UTC
I am not too worried about using gconf to store these new settings.  We already use gconf for similar purposes, for example the stored column order.  I applied a patch similar to that in comment #11 to cvs HEAD.  Thanks.