diff options
author | rbuj <[email protected]> | 2021-01-18 21:39:36 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2021-01-22 21:43:40 +0000 |
commit | 071933646ef80fff6295b581376d018ba8ddc39a (patch) | |
tree | 6d7b062669b526e2c21de06bb5e4512b424a42bd /mate-session/gsm-inhibit-dialog.c | |
parent | dfcbc043483a1f94e5da312629351e52d3d5b3cd (diff) | |
download | mate-session-manager-071933646ef80fff6295b581376d018ba8ddc39a.tar.bz2 mate-session-manager-071933646ef80fff6295b581376d018ba8ddc39a.tar.xz |
Support xscreensaver when mate-screensaver is not available
Diffstat (limited to 'mate-session/gsm-inhibit-dialog.c')
-rw-r--r-- | mate-session/gsm-inhibit-dialog.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/mate-session/gsm-inhibit-dialog.c b/mate-session/gsm-inhibit-dialog.c index a4e86e8..c79fa18 100644 --- a/mate-session/gsm-inhibit-dialog.c +++ b/mate-session/gsm-inhibit-dialog.c @@ -91,13 +91,24 @@ G_DEFINE_TYPE (GsmInhibitDialog, gsm_inhibit_dialog, GTK_TYPE_DIALOG) static void lock_screen (GsmInhibitDialog *dialog) { - GError *error; - error = NULL; - g_spawn_command_line_async ("mate-screensaver-command --lock", &error); - if (error != NULL) { - g_warning ("Couldn't lock screen: %s", error->message); - g_error_free (error); + gchar **screen_locker_command; + + if ((screen_locker_command = gsm_get_screen_locker_command ()) != NULL) { + GError *error = NULL; + + g_spawn_async (NULL, screen_locker_command, NULL, G_SPAWN_DEFAULT, + NULL, NULL, NULL, &error); + + if (error != NULL) { + g_warning ("Couldn't lock screen: %s", error->message); + g_error_free (error); + } + + } else { + g_warning ("Couldn't find any screen locker"); } + + g_strfreev (screen_locker_command); } static void |