From 6aab72e872ff91185b939f8716e13f0fbc2b16d0 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Thu, 2 Mar 2006 19:14:51 +0000 Subject: make EOG gnome-screen-saver if this is present (Fixes bug #333142). Patch 2006-03-02 Lucas Rocha * libeog/eog-full-screen.c (disable_screen_saver): make EOG gnome-screen-saver if this is present (Fixes bug #333142). Patch from Oliver Grawert with some fixes. --- ChangeLog | 7 +++++++ libeog/eog-full-screen.c | 30 +++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1201667e..1207898a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-02 Lucas Rocha + + * libeog/eog-full-screen.c (disable_screen_saver): make + EOG gnome-screen-saver if this is present (Fixes + bug #333142). Patch from Oliver Grawert + with some fixes. + 2006-03-02 Lucas Rocha * libeog/eog-wrap-list.c (handle_canvas_scroll, diff --git a/libeog/eog-full-screen.c b/libeog/eog-full-screen.c index 676174ce..96390f1d 100644 --- a/libeog/eog-full-screen.c +++ b/libeog/eog-full-screen.c @@ -318,13 +318,19 @@ check_automatic_switch (gpointer data) return TRUE; } -/* Works only for xscreensaver */ static gboolean disable_screen_saver (gpointer data) { EogFullScreenPrivate *priv; gboolean success = TRUE; - char *argv[] = { "xscreensaver-command", "-deactivate", NULL }; + gchar **argv; + + if (g_find_program_in_path ("gnome-screensaver-command") != NULL) { + g_shell_parse_argv ("gnome-screensaver-command --poke", NULL, &argv, NULL); + } + else { + g_shell_parse_argv ("xscreensaver-command -deactivate", NULL, &argv, NULL); + } priv = EOG_FULL_SCREEN (data)->priv; @@ -334,21 +340,23 @@ disable_screen_saver (gpointer data) G_SPAWN_STDERR_TO_DEV_NULL; success = g_spawn_sync (NULL, /* working directory */ - argv, /* command */ - NULL, /* environment */ - flags, /* flags */ - NULL, /* child setup func */ - NULL, /* function data */ - NULL, /* standard output */ + argv, /* command */ + NULL, /* environment */ + flags, /* flags */ + NULL, /* child setup func */ + NULL, /* function data */ + NULL, /* standard output */ NULL, /* standard error */ - NULL, /* exit status */ - NULL); /* GError */ + NULL, /* exit status */ + NULL); /* GError */ } if (!success) { priv->activity_timeout_id = 0; - g_print ("Disable xscreensaver failed.\n"); + g_print ("Disable screensaver failed.\n"); } + + g_strfreev (argv); return success; } -- cgit v1.2.1