[gnome-boxes/gnome-3-6] Emit proper notifications for App.fullscreen



commit 83fb74d57be5dc26af3d7f8bad992be5613cf789
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Oct 26 15:57:54 2012 +0200

    Emit proper notifications for App.fullscreen
    
    We don't want to send notify emissions when we set the fullscreen
    property as that only requests an async change (reading the property
    will not have changed value yet). So, we disable automatic notifcation
    for the property and notify manually when the real state changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686938

 src/app.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index fc5d022..0e6cf36 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -12,6 +12,7 @@ private class Boxes.App: Boxes.UI {
     public static App app;
     public override Clutter.Actor actor { get { return stage; } }
     public Gtk.ApplicationWindow window;
+    [CCode (notify = false)]
     public bool fullscreen {
         get { return WindowState.FULLSCREEN in window.get_window ().get_state (); }
         set {
@@ -21,6 +22,7 @@ private class Boxes.App: Boxes.UI {
                 window.unfullscreen ();
         }
     }
+
     private bool maximized { get { return WindowState.MAXIMIZED in window.get_window ().get_state (); } }
     public Gtk.Notebook notebook;
     public ClutterWidget embed;
@@ -398,7 +400,10 @@ private class Boxes.App: Boxes.UI {
 
             return false;
         });
-        window.window_state_event.connect (() => {
+        window.window_state_event.connect ((event) => {
+            if (WindowState.FULLSCREEN in event.changed_mask)
+                this.notify_property ("fullscreen");
+
             if (fullscreen)
                 return false;
 



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