diff options
Diffstat (limited to 'mate-session/gsm-inhibit-dialog.c')
-rw-r--r-- | mate-session/gsm-inhibit-dialog.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/mate-session/gsm-inhibit-dialog.c b/mate-session/gsm-inhibit-dialog.c index a4e86e8..89f46e0 100644 --- a/mate-session/gsm-inhibit-dialog.c +++ b/mate-session/gsm-inhibit-dialog.c @@ -91,13 +91,25 @@ 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 | G_SPAWN_SEARCH_PATH, + 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 |