summaryrefslogtreecommitdiff
path: root/mate-session/gsm-inhibit-dialog.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-18 21:39:36 +0100
committerraveit65 <[email protected]>2021-03-27 11:05:14 +0100
commit81b6185eb3d47cba4d8f1232556e176b9f810015 (patch)
treed91d65496cf888556f0b6be262f2f3089d2149d7 /mate-session/gsm-inhibit-dialog.c
parentad3ea9108d86d1ba0a5da68fd3af5a0719c32fa9 (diff)
downloadmate-session-manager-81b6185eb3d47cba4d8f1232556e176b9f810015.tar.bz2
mate-session-manager-81b6185eb3d47cba4d8f1232556e176b9f810015.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.c23
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