summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Rocha <lucasr@gnome.org>2006-03-02 19:14:51 +0000
committerLucas Almeida Rocha <lucasr@src.gnome.org>2006-03-02 19:14:51 +0000
commit6aab72e872ff91185b939f8716e13f0fbc2b16d0 (patch)
tree9b8a72be58aa725feca310a1f26ffd11cf7533f2
parent692935544ee50d92a7f4cf56e999f1c49bd87577 (diff)
downloadeog-6aab72e872ff91185b939f8716e13f0fbc2b16d0.tar.gz
make EOG gnome-screen-saver if this is present (Fixes bug #333142). Patch
2006-03-02 Lucas Rocha <lucasr@gnome.org> * libeog/eog-full-screen.c (disable_screen_saver): make EOG gnome-screen-saver if this is present (Fixes bug #333142). Patch from Oliver Grawert <ogra@ubuntu.com> with some fixes.
-rw-r--r--ChangeLog7
-rw-r--r--libeog/eog-full-screen.c30
2 files changed, 26 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 1201667e..1207898a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-03-02 Lucas Rocha <lucasr@gnome.org>
+ * libeog/eog-full-screen.c (disable_screen_saver): make
+ EOG gnome-screen-saver if this is present (Fixes
+ bug #333142). Patch from Oliver Grawert <ogra@ubuntu.com>
+ with some fixes.
+
+2006-03-02 Lucas Rocha <lucasr@gnome.org>
+
* libeog/eog-wrap-list.c (handle_canvas_scroll,
eog_wrap_list_construct): mouse scroll wheel make image
switching on collection pane (Fixes bug #331645).
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;
}