[cheese] Show top bar when moving mouse in fullscreen mode



commit f04e641b30e65d8fc6f96d1eb4d8758e195aecd4
Author: Rashi Aswani <aswanirashi19 gmail com>
Date:   Fri Nov 15 17:57:13 2013 +0530

    Show top bar when moving mouse in fullscreen mode
    
    Store whether the window was maximized before entering fullscreeen mode,
    and return to the same state when exiting fullscreen.
    
    https://wiki.gnome.org/Design/Apps/Cheese#Full_Screen
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711811

 src/cheese-window.vala |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 0a14856..9e83ddb 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -93,6 +93,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
   private bool is_bursting;
   private bool is_effects_selector_active;
   private bool action_cancelled;
+    private bool was_maximized;
 
   private Cheese.Camera   camera;
   private Cheese.FileUtil fileutil;
@@ -119,6 +120,16 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
         GLib.Object (application: application);
     }
 
+    private bool on_window_state_change_event (Gtk.Widget widget,
+                                               Gdk.EventWindowState event)
+    {
+        was_maximized = (((event.new_window_state - event.changed_mask)
+                          & Gdk.WindowState.MAXIMIZED) != 0);
+
+        window_state_event.disconnect (on_window_state_change_event);
+        return false;
+    }
+
     /**
     * Popup a context menu when right-clicking on a thumbnail.
     *
@@ -466,6 +477,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
     fullscreen_timeout.attach (null);
     fullscreen_timeout.set_callback (() => {buttons_area.hide ();
                                             clear_fullscreen_timeout ();
+                                            this.fullscreen ();
                                             return true; });
   }
 
@@ -483,6 +495,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
                                                     EventMotion e)
     {
         clear_fullscreen_timeout ();
+        this.unfullscreen ();
+        this.maximize ();
         buttons_area.show ();
         set_fullscreen_timeout ();
         return true;
@@ -503,6 +517,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
     is_fullscreen = fullscreen;
     if (fullscreen)
     {
+            window_state_event.connect (on_window_state_change_event);
+
       if (is_wide_mode)
       {
         thumbnails_right.hide ();
@@ -537,6 +553,15 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
       buttons_area.show ();
       viewport_widget.motion_notify_event.disconnect (fullscreen_motion_notify_callback);
       this.unfullscreen ();
+
+            if (was_maximized)
+            {
+                this.maximize ();
+            }
+            else
+            {
+                this.unmaximize ();
+            }
     }
   }
 


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