[gnome-tetravex] Connect to size_allocate.



commit 34bc522d4f52eba37596c77c5145795fea4b6761
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Jan 31 22:26:50 2015 +0100

    Connect to size_allocate.

 src/gnome-tetravex.vala |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index 83d7ef1..91d57dd 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -89,7 +89,7 @@ public class Tetravex : Gtk.Application
 
         window = builder.get_object ("gnome-tetravex-window") as Gtk.ApplicationWindow;
         this.add_window (window);
-        window.configure_event.connect (window_configure_event_cb);
+        window.size_allocate.connect (size_allocate_cb);
         window.window_state_event.connect (window_state_event_cb);
         window.set_default_size (settings.get_int ("window-width"), settings.get_int ("window-height"));
         if (settings.get_boolean ("window-is-maximized"))
@@ -191,15 +191,12 @@ public class Tetravex : Gtk.Application
         new_game ();
     }
 
-    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]