[gnome-klotski] Connect to size_allocate.



commit c8f520466825f3409b752302b6cc9e71421b4b53
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Feb 2 04:42:13 2015 +0100

    Connect to size_allocate.

 src/gnome-klotski.vala |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-klotski.vala b/src/gnome-klotski.vala
index 7c09b17..4178d5b 100644
--- a/src/gnome-klotski.vala
+++ b/src/gnome-klotski.vala
@@ -502,7 +502,7 @@ public class Klotski : Gtk.Application
 
         window = new Gtk.ApplicationWindow (this);
         window.set_titlebar (headerbar);
-        window.configure_event.connect (window_configure_event_cb);
+        window.size_allocate.connect (size_allocate_cb);
         window.window_state_event.connect (window_state_event_cb);
 
         int ww = int.max (settings.get_int ("window-width"), MINWIDTH);
@@ -691,15 +691,12 @@ public class Klotski : Gtk.Application
             cell.weight = 400;
     }
 
-    private bool window_configure_event_cb (Gdk.EventConfigure event)
+    private void size_allocate_cb (Gtk.Allocation allocation)
     {
-        if (!is_maximized)
-        {
-            window_width = event.width;
-            window_height = event.height;
-        }
-
-        return false;
+        if (is_maximized)
+            return;
+        window_width = allocation.width;
+        window_height = allocation.height;
     }
 
     private bool window_state_event_cb (Gdk.EventWindowState event)


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