diff options
author | Rashi Aswani <aswanirashi19@gmail.com> | 2013-11-15 17:57:13 +0530 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2013-11-17 11:06:40 +0000 |
commit | f04e641b30e65d8fc6f96d1eb4d8758e195aecd4 (patch) | |
tree | 394c478a38b326351d1db706054d3e155f16c559 /src | |
parent | 3b3105828787f988c0865e4ef4117d0742f6b527 (diff) | |
download | cheese-f04e641b30e65d8fc6f96d1eb4d8758e195aecd4.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | 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 0a148566..9e83ddbf 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 (); + } } } |