summaryrefslogtreecommitdiff
path: root/mate-panel/panel-util.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-23 22:52:04 +0100
committerrbuj <[email protected]>2021-01-23 22:52:04 +0100
commit886c8722ea2311471f8131f7906442df2d209237 (patch)
treebc3d6d74c749c4eb2b3d7e414b9026befc10df4f /mate-panel/panel-util.c
parent620603885fc680c0a46fd090ae284fb2d631302a (diff)
downloadmate-panel-886c8722ea2311471f8131f7906442df2d209237.tar.bz2
mate-panel-886c8722ea2311471f8131f7906442df2d209237.tar.xz
mate-panel: remove mate-screensaver support
Diffstat (limited to 'mate-panel/panel-util.c')
-rw-r--r--mate-panel/panel-util.c54
1 files changed, 14 insertions, 40 deletions
diff --git a/mate-panel/panel-util.c b/mate-panel/panel-util.c
index 093a0099..5b7d775d 100644
--- a/mate-panel/panel-util.c
+++ b/mate-panel/panel-util.c
@@ -375,54 +375,28 @@ panel_load_icon (GtkIconTheme *icon_theme,
return surface;
}
-static char* panel_lock_screen_action_get_command(const char* action)
+static char*
+panel_lock_screen_action_get_command (const char* action)
{
- char* command = NULL;
- gboolean use_gscreensaver = FALSE;
-
- if (panel_is_program_in_path("mate-screensaver-command") && panel_is_program_in_path("mate-screensaver-preferences"))
- {
- use_gscreensaver = TRUE;
- }
- else if (!panel_is_program_in_path("xscreensaver-command"))
- {
- return NULL;
- }
+ char *command = NULL;
if (strcmp (action, "prefs") == 0)
{
- if (use_gscreensaver)
- {
- command = g_strdup ("mate-screensaver-preferences");
- }
- else if (panel_is_program_in_path ("xscreensaver-demo"))
- {
- command = g_strdup ("xscreensaver-demo");
- }
- else
- {
- command = NULL;
- }
+ if (!panel_is_program_in_path ("xscreensaver-demo"))
+ return NULL;
+
+ command = g_strdup ("xscreensaver-demo");
}
else if (strcmp (action, "activate") == 0 || strcmp(action, "lock") == 0)
{
- /* Neither mate-screensaver or xscreensaver allow root
- * to lock the screen */
+ /* Don't allow root to lock the screen */
if (geteuid () == 0)
- {
- command = NULL;
- }
- else
- {
- if (use_gscreensaver)
- {
- command = g_strdup_printf("mate-screensaver-command --%s", action);
- }
- else
- {
- command = g_strdup_printf("xscreensaver-command -%s", action);
- }
- }
+ return NULL;
+
+ if (!panel_is_program_in_path("xscreensaver-command"))
+ return NULL;
+
+ command = g_strdup_printf("xscreensaver-command -%s", action);
}
return command;