Bug#179299: patch to make gconf-editor remember its size
Chris AtLee
Chris AtLee <chris@atlee.ca>, 179299@bugs.debian.org
Thu, 01 Jul 2004 11:00:28 -0400
Package: gconf-editor
Version: 2.6.2-1
Followup-For: Bug #179299
I made the following patch to allow gconf-editor to remember its size.
Not sure if the gconf keys are appropriate, but they can be changed
easily enough.
diff -urN gconf-editor-2.6.2.old/src/gconf-editor-application.c gconf-editor-2.6.2/src/gconf-editor-application.c
--- gconf-editor-2.6.2.old/src/gconf-editor-application.c 2002-01-14 13:13:05.000000000 -0500
+++ gconf-editor-2.6.2/src/gconf-editor-application.c 2004-07-01 10:54:22.000000000 -0400
@@ -20,6 +20,7 @@
#include "gconf-editor-window.h"
#include <gtk/gtkmain.h>
+#include <gconf/gconf-client.h>
static GSList *editor_windows = NULL;
@@ -27,22 +28,46 @@
gconf_editor_application_window_destroyed (GtkObject *window)
{
editor_windows = g_slist_remove (editor_windows, window);
-
if (editor_windows == NULL)
- gtk_main_quit ();
+ gtk_main_quit ();
+}
+
+static gboolean
+gconf_editor_application_window_configured (GtkObject *window,
+ GdkEventConfigure *event)
+{
+ GConfClient *conf = gconf_client_get_default();
+ gconf_client_set_int(conf, "/apps/gconf-editor/window_width", event->width, NULL);
+ gconf_client_set_int(conf, "/apps/gconf-editor/window_height", event->height, NULL);
+ return FALSE;
}
GtkWidget *
gconf_editor_application_create_editor_window (void)
{
GtkWidget *window;
+ gint w,h;
+ GConfClient *conf;
window = g_object_new (GCONF_TYPE_EDITOR_WINDOW, NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gconf_editor_application_window_destroyed), NULL);
+
+ g_signal_connect (window, "configure-event",
+ G_CALLBACK (gconf_editor_application_window_configured), NULL);
editor_windows = g_slist_prepend (editor_windows, window);
+ /* Resize window to previous size */
+ conf = gconf_client_get_default();
+
+ w = gconf_client_get_int(conf, "/apps/gconf-editor/window_width", NULL);
+ h = gconf_client_get_int(conf, "/apps/gconf-editor/window_height", NULL);
+ if (w != 0 && h != 0)
+ {
+ gtk_window_resize((GtkWindow*)window, w, h);
+ }
+
return window;
}
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.6-1-k7
Locale: LANG=C, LC_CTYPE=C
Versions of packages gconf-editor depends on:
ii libatk1.0-0 1.6.1-2 The ATK accessibility toolkit
ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an
ii libgconf2-4 2.6.1-2 GNOME configuration database syste
ii libglib2.0-0 2.4.2-1 The GLib library of C routines
ii libgtk2.0-0 2.4.3-1 The GTK+ graphical user interface
ii liborbit2 1:2.10.2-1.1 libraries for ORBit2 - a CORBA ORB
ii libpango1.0-0 1.4.0-4 Layout and rendering of internatio
ii libpopt0 1.7-4 lib for parsing cmdline parameters
-- no debconf information