[gnome-tetravex] Do not save size when tiled.



commit 13d29e55744c06dd86050304a77104ba3e7bb5d6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Jan 31 22:29:48 2015 +0100

    Do not save size when tiled.

 src/gnome-tetravex.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index 91d57dd..49bea3f 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -28,6 +28,7 @@ public class Tetravex : Gtk.Application
     private int window_width;
     private int window_height;
     private bool is_maximized;
+    private bool is_tiled;
 
     private Gtk.Stack new_game_solve_stack;
     private Gtk.Stack play_pause_stack;
@@ -193,7 +194,7 @@ public class Tetravex : Gtk.Application
 
     private void size_allocate_cb (Gtk.Allocation allocation)
     {
-        if (is_maximized)
+        if (is_maximized || is_tiled)
             return;
         window_width = allocation.width;
         window_height = allocation.height;
@@ -203,7 +204,9 @@ public class Tetravex : Gtk.Application
     {
         if ((event.changed_mask & Gdk.WindowState.MAXIMIZED) != 0)
             is_maximized = (event.new_window_state & Gdk.WindowState.MAXIMIZED) != 0;
-
+        /* We don’t save this state, but track it for saving size allocation */
+        if ((event.changed_mask & Gdk.WindowState.TILED) != 0)
+            is_tiled = (event.new_window_state & Gdk.WindowState.TILED) != 0;
         return false;
     }
 


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