From: Carlos Garcia Campos Date: Sun, 20 Mar 2011 10:52:12 +0000 (+0100) Subject: presentation: Enable screensaver again when window loses the focus X-Git-Tag: EVINCE_2_91_92~10 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=c935a25cdd0c9791158b1252835142472152d6cc;p=evince.git presentation: Enable screensaver again when window loses the focus Fixes bug #644133. --- diff --git a/shell/ev-window.c b/shell/ev-window.c index ad9eb143..ee6160b7 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -3976,6 +3976,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) { @@ -4005,6 +4021,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,