[gnome-todo] window: save window geometry on configure event



commit e958133405fc50b235fa5006cc854046f1509f59
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Aug 27 09:28:27 2015 -0300

    window: save window geometry on configure event

 src/gtd-window.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/gtd-window.c b/src/gtd-window.c
index 884bc22..df5ec13 100644
--- a/src/gtd-window.c
+++ b/src/gtd-window.c
@@ -720,6 +720,32 @@ gtd_window__list_removed (GtdManager  *manager,
 }
 
 static gboolean
+gtd_window_configure_event (GtkWidget         *widget,
+                            GdkEventConfigure *event)
+{
+  GtdWindowPrivate *priv;
+  GtdWindow *window;
+  gboolean retval;
+
+  window = GTD_WINDOW (widget);
+  priv = window->priv;
+
+  if (priv->save_geometry_timeout_id != 0)
+    {
+      g_source_remove (priv->save_geometry_timeout_id);
+      priv->save_geometry_timeout_id = 0;
+    }
+
+  priv->save_geometry_timeout_id = g_timeout_add (SAVE_GEOMETRY_ID_TIMEOUT,
+                                                  gtd_window__save_geometry,
+                                                  window);
+
+  retval = GTK_WIDGET_CLASS (gtd_window_parent_class)->configure_event (widget, event);
+
+  return retval;
+}
+
+static gboolean
 gtd_window_state_event (GtkWidget           *widget,
                         GdkEventWindowState *event)
 {
@@ -911,6 +937,7 @@ gtd_window_class_init (GtdWindowClass *klass)
   object_class->get_property = gtd_window_get_property;
   object_class->set_property = gtd_window_set_property;
 
+  widget_class->configure_event = gtd_window_configure_event;
   widget_class->window_state_event = gtd_window_state_event;
 
   /**


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