From ba532efcd35e1adb0e84e774418787c32c590b19 Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 10 Dec 2014 02:15:43 +0100 Subject: presentation: Enable screensaver again when window loses the focus Taken from evince commit: c935a25cdd0c9791158b1252835142472152d6cc From: Carlos Garcia Campos Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=644133 --- shell/ev-window.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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, -- cgit v1.2.1