]> www.fi.muni.cz Git - evince.git/commitdiff
Intercept window manager's fullscreen request in order to run/stop
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 20 Jul 2008 17:54:20 +0000 (17:54 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 20 Jul 2008 17:54:20 +0000 (17:54 +0000)
2008-07-20  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-window.c: (ev_window_state_event),
(ev_window_class_init):

Intercept window manager's fullscreen request in order to run/stop
fullscreen mode. Fixes bug #493541.

svn path=/trunk/; revision=3078

ChangeLog
shell/ev-window.c

index 035149370b31111124e1dec6215a27afb8af1a16..93e4cbcbd6424c2df50e0012e0c81d097842ea29 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-20  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (ev_window_state_event),
+       (ev_window_class_init):
+
+       Intercept window manager's fullscreen request in order to run/stop
+       fullscreen mode. Fixes bug #493541.
+       
 2008-07-20  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-window.c: (find_bar_visibility_changed_cb):
index ec23937eea5deaca5fd71837a4ca11b4473eb98a..7d08ebf4704c367bbf50ce6c36646e4c71286df8 100644 (file)
@@ -3118,6 +3118,35 @@ ev_window_screen_changed (GtkWidget *widget,
        }
 }
 
+static gboolean
+ev_window_state_event (GtkWidget           *widget,
+                      GdkEventWindowState *event)
+{
+       EvWindow *window = EV_WINDOW (widget);
+       EvView   *view = EV_VIEW (window->priv->view);
+
+       if (GTK_WIDGET_CLASS (ev_window_parent_class)->window_state_event) {
+               GTK_WIDGET_CLASS (ev_window_parent_class)->window_state_event (widget, event);
+       }
+
+       if ((event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) == 0)
+               return FALSE;
+
+       if (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) {
+               if (ev_view_get_fullscreen (view) || ev_view_get_presentation (view))
+                       return FALSE;
+               
+               ev_window_run_fullscreen (window);
+       } else {
+               if (ev_view_get_fullscreen (view))
+                       ev_window_stop_fullscreen (window, FALSE);
+               else if (ev_view_get_presentation (view))
+                       ev_window_stop_presentation (window, FALSE);
+       }
+
+       return FALSE;
+}
+
 static void
 ev_window_set_page_mode (EvWindow         *window,
                         EvWindowPageMode  page_mode)
@@ -4320,6 +4349,7 @@ ev_window_class_init (EvWindowClass *ev_window_class)
        g_object_class->finalize = ev_window_finalize;
 
        widget_class->screen_changed = ev_window_screen_changed;
+       widget_class->window_state_event = ev_window_state_event;
 
        g_type_class_add_private (g_object_class, sizeof (EvWindowPrivate));
 }