summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-10 02:15:43 +0100
committerinfirit <[email protected]>2014-12-10 02:15:43 +0100
commitba532efcd35e1adb0e84e774418787c32c590b19 (patch)
tree49e65b1ce78964176631b4177b8081a6b734647e /shell
parent49ec363e5cd53042368bbc5056f6d5aa57e0b0b5 (diff)
downloadatril-ba532efcd35e1adb0e84e774418787c32c590b19.tar.bz2
atril-ba532efcd35e1adb0e84e774418787c32c590b19.tar.xz
presentation: Enable screensaver again when window loses the focus
Taken from evince commit: c935a25cdd0c9791158b1252835142472152d6cc From: Carlos Garcia Campos <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=644133
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-window.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 12341201..d6b3ef7e 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4120,6 +4120,22 @@ ev_window_view_presentation_finished (EvWindow *window)
ev_window_stop_presentation (window, TRUE);
}
+static gboolean
+ev_window_view_presentation_focus_in (EvWindow *window)
+{
+ ev_application_screensaver_disable (EV_APP);
+
+ return FALSE;
+}
+
+static gboolean
+ev_window_view_presentation_focus_out (EvWindow *window)
+{
+ ev_application_screensaver_enable (EV_APP);
+
+ return FALSE;
+}
+
static void
ev_window_run_presentation (EvWindow *window)
{
@@ -4154,6 +4170,12 @@ ev_window_run_presentation (EvWindow *window)
g_signal_connect_swapped (window->priv->presentation_view, "external-link",
G_CALLBACK (view_external_link_cb),
window);
+ g_signal_connect_swapped (window->priv->presentation_view, "focus-in-event",
+ G_CALLBACK (ev_window_view_presentation_focus_in),
+ window);
+ g_signal_connect_swapped (window->priv->presentation_view, "focus-out-event",
+ G_CALLBACK (ev_window_view_presentation_focus_out),
+ window);
gtk_box_pack_start (GTK_BOX (window->priv->main_box),
window->priv->presentation_view,