[iagno] Do not save size when tiled.



commit 6ee7d6f2fc1971063773dd306901fba87e6dd17f
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Jan 31 12:47:59 2015 +0100

    Do not save size when tiled.

 src/iagno.vala |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index 536219c..efb7b30 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -13,7 +13,7 @@ public class Iagno : Gtk.Application
 {
     /* Application settings */
     private Settings settings;
-    private bool is_fullscreen;
+    private bool is_fullscreen_or_tiled;
     private bool is_maximized;
     private int window_width;
     private int window_height;
@@ -239,7 +239,7 @@ public class Iagno : Gtk.Application
 
     private void size_allocate_cb (Gtk.Allocation allocation)
     {
-        if (is_maximized || is_fullscreen)
+        if (is_maximized || is_fullscreen_or_tiled)
             return;
         window_width = allocation.width;
         window_height = allocation.height;
@@ -249,8 +249,9 @@ public class Iagno : Gtk.Application
     {
         if ((event.changed_mask & Gdk.WindowState.MAXIMIZED) != 0)
             is_maximized = (event.new_window_state & Gdk.WindowState.MAXIMIZED) != 0;
-        if ((event.changed_mask & Gdk.WindowState.FULLSCREEN) != 0)
-            is_fullscreen = (event.new_window_state & Gdk.WindowState.FULLSCREEN) != 0;
+        /* We don’t save these states, but track them for saving size allocation */
+        if ((event.changed_mask & (Gdk.WindowState.FULLSCREEN | Gdk.WindowState.TILED)) != 0)
+            is_fullscreen_or_tiled = (event.new_window_state & (Gdk.WindowState.FULLSCREEN | 
Gdk.WindowState.TILED)) != 0;
         return false;
     }
 


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