[evince] presentation: Enable screensaver again when window loses the focus
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] presentation: Enable screensaver again when window loses the focus
- Date: Sun, 20 Mar 2011 10:53:26 +0000 (UTC)
commit c935a25cdd0c9791158b1252835142472152d6cc
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sun Mar 20 11:52:12 2011 +0100
presentation: Enable screensaver again when window loses the focus
Fixes bug #644133.
shell/ev-window.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index ad9eb14..ee6160b 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]