[gnome-video-arcade] Make the main window position persistent.



commit cb4d97bd004b172431021eeed1a042bdea7d4422
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Mar 6 14:45:18 2010 -0500

    Make the main window position persistent.

 data/gnome-video-arcade.schemas |   22 ++++++++++++++++++++++
 src/gconf-bridge.c              |    4 ++++
 src/gva-main.c                  |    2 +-
 3 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/data/gnome-video-arcade.schemas b/data/gnome-video-arcade.schemas
index 062f928..54e0134 100644
--- a/data/gnome-video-arcade.schemas
+++ b/data/gnome-video-arcade.schemas
@@ -251,5 +251,27 @@
       </locale>
     </schema>
 
+    <schema>
+      <applyto>/apps/gnome-video-arcade/window-x</applyto>
+      <key>/schemas/apps/gnome-video-arcade/window-x</key>
+      <owner>gnome-video-arcade</owner>
+      <type>int</type>
+      <locale name="C">
+        <short>Window X coordinate</short>
+        <long>The X coordinate of the main window.</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <applyto>/apps/gnome-video-arcade/window-y</applyto>
+      <key>/schemas/apps/gnome-video-arcade/window-y</key>
+      <owner>gnome-video-arcade</owner>
+      <type>int</type>
+      <locale name="C">
+        <short>Window Y coordinate</short>
+        <long>The Y coordinate of the main window.</long>
+      </locale>
+    </schema>
+
   </schemalist>
 </gconfschemafile>
diff --git a/src/gconf-bridge.c b/src/gconf-bridge.c
index e3b684d..b282aa4 100644
--- a/src/gconf-bridge.c
+++ b/src/gconf-bridge.c
@@ -685,6 +685,10 @@ window_binding_unmap_cb (GtkWindow     *window,
         if (binding->sync_timeout_id > 0)
                 g_source_remove (binding->sync_timeout_id);
 
+        /* XXX It's too late to record the window position.
+         *     gtk_window_get_position() will report (0, 0). */
+        binding->bind_pos = FALSE;
+
         window_binding_perform_scheduled_sync (binding);
 
         return FALSE;
diff --git a/src/gva-main.c b/src/gva-main.c
index 2d33eef..bf3777f 100644
--- a/src/gva-main.c
+++ b/src/gva-main.c
@@ -185,7 +185,7 @@ gva_main_init (void)
 
         gconf_bridge_bind_window (
                 gconf_bridge_get (), GVA_GCONF_WINDOW_PREFIX,
-                GTK_WINDOW (GVA_WIDGET_MAIN_WINDOW), TRUE, FALSE);
+                GTK_WINDOW (GVA_WIDGET_MAIN_WINDOW), TRUE, TRUE);
 
         /* Initialize the search entry. */
         text = gva_main_get_last_search_text ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]