diff options
author | Lucas Rocha <lucasr@gnome.org> | 2006-03-02 19:14:51 +0000 |
---|---|---|
committer | Lucas Almeida Rocha <lucasr@src.gnome.org> | 2006-03-02 19:14:51 +0000 |
commit | 6aab72e872ff91185b939f8716e13f0fbc2b16d0 (patch) | |
tree | 9b8a72be58aa725feca310a1f26ffd11cf7533f2 | |
parent | 692935544ee50d92a7f4cf56e999f1c49bd87577 (diff) | |
download | eog-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-- | ChangeLog | 7 | ||||
-rw-r--r-- | libeog/eog-full-screen.c | 30 |
2 files changed, 26 insertions, 11 deletions
@@ -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; } |