summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-23 23:13:20 +0100
committerrbuj <[email protected]>2021-01-23 23:42:47 +0100
commitf02ac72a6144b9891c63762992ceee6828c9f2b2 (patch)
tree69fa04b20333f94c61846bf13cb3648dd3901ecb
parent071933646ef80fff6295b581376d018ba8ddc39a (diff)
downloadmate-session-manager-drop-mate-screensaver.tar.bz2
mate-session-manager-drop-mate-screensaver.tar.xz
mate-session: remove mate-screensaver supportdrop-mate-screensaver
-rw-r--r--mate-session/gsm-manager.c71
-rw-r--r--mate-session/gsm-util.c1
2 files changed, 11 insertions, 61 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index 4be8eb0..5f3659d 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -92,9 +92,6 @@
#define KEY_IDLE_DELAY "idle-delay"
#define KEY_AUTOSAVE "auto-save-session"
-#define SCREENSAVER_SCHEMA "org.mate.screensaver"
-#define KEY_SLEEP_LOCK "lock-enabled"
-
#ifdef __GNUC__
#define UNUSED_VARIABLE __attribute__ ((unused))
#else
@@ -142,7 +139,6 @@ typedef struct {
GSettings *settings_session;
GSettings *settings_lockdown;
- GSettings *settings_screensaver;
const char *renderer;
@@ -1208,33 +1204,14 @@ manager_switch_user (GsmManager *manager)
}
}
-static gboolean
-sleep_lock_is_enabled (GsmManager *manager)
-{
- GsmManagerPrivate *priv;
-
- priv = gsm_manager_get_instance_private (manager);
- if (priv->settings_screensaver != NULL)
- return g_settings_get_boolean (priv->settings_screensaver,
- KEY_SLEEP_LOCK);
- else
- return FALSE;
-}
-
static void
-manager_perhaps_lock (GsmManager *manager)
+manager_perhaps_lock (void)
{
gchar **screen_locker_command;
if ((screen_locker_command = gsm_get_screen_locker_command ()) != NULL) {
GError *error = NULL;
- /* only lock if mate-screensaver is set to lock */
- if (!g_strcmp0 (screen_locker_command[0], "mate-screensaver-command") &&
- !sleep_lock_is_enabled (manager)) {
- goto clear_screen_locker_command;
- }
-
/* do this sync to ensure it's on the screen when we start suspending */
g_spawn_sync (NULL, screen_locker_command, NULL, G_SPAWN_DEFAULT,
NULL, NULL, NULL, NULL, NULL, &error);
@@ -1248,13 +1225,11 @@ manager_perhaps_lock (GsmManager *manager)
g_warning ("Couldn't find any screen locker");
}
-clear_screen_locker_command:
-
g_strfreev (screen_locker_command);
}
static void
-manager_attempt_hibernate (GsmManager *manager)
+manager_attempt_hibernate (void)
{
#ifdef HAVE_SYSTEMD
if (LOGIND_RUNNING()) {
@@ -1264,7 +1239,7 @@ manager_attempt_hibernate (GsmManager *manager)
systemd = gsm_get_systemd ();
/* lock the screen before we suspend */
- manager_perhaps_lock (manager);
+ manager_perhaps_lock ();
gsm_systemd_attempt_hibernate (systemd);
}
@@ -1276,7 +1251,7 @@ manager_attempt_hibernate (GsmManager *manager)
gboolean can_hibernate = gsm_consolekit_can_hibernate (consolekit);
if (can_hibernate) {
/* lock the screen before we suspend */
- manager_perhaps_lock (manager);
+ manager_perhaps_lock ();
gsm_consolekit_attempt_hibernate (consolekit);
}
@@ -1286,7 +1261,7 @@ manager_attempt_hibernate (GsmManager *manager)
}
static void
-manager_attempt_suspend (GsmManager *manager)
+manager_attempt_suspend (void)
{
#ifdef HAVE_SYSTEMD
if (LOGIND_RUNNING()) {
@@ -1296,7 +1271,7 @@ manager_attempt_suspend (GsmManager *manager)
systemd = gsm_get_systemd ();
/* lock the screen before we suspend */
- manager_perhaps_lock (manager);
+ manager_perhaps_lock ();
gsm_systemd_attempt_suspend (systemd);
}
@@ -1308,7 +1283,7 @@ manager_attempt_suspend (GsmManager *manager)
gboolean can_suspend = gsm_consolekit_can_suspend (consolekit);
if (can_suspend) {
/* lock the screen before we suspend */
- manager_perhaps_lock (manager);
+ manager_perhaps_lock ();
gsm_consolekit_attempt_suspend (consolekit);
}
@@ -1329,10 +1304,10 @@ do_inhibit_dialog_action (GsmManager *manager,
manager_switch_user (manager);
break;
case GSM_LOGOUT_ACTION_HIBERNATE:
- manager_attempt_hibernate (manager);
+ manager_attempt_hibernate ();
break;
case GSM_LOGOUT_ACTION_SLEEP:
- manager_attempt_suspend (manager);
+ manager_attempt_suspend ();
break;
case GSM_LOGOUT_ACTION_SHUTDOWN:
case GSM_LOGOUT_ACTION_REBOOT:
@@ -2654,10 +2629,6 @@ gsm_manager_dispose (GObject *object)
priv->settings_lockdown = NULL;
}
- if (priv->settings_screensaver) {
- g_object_unref (priv->settings_screensaver);
- priv->settings_screensaver = NULL;
- }
G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
}
@@ -2836,9 +2807,6 @@ on_presence_status_changed (GsmPresence *presence,
static void
gsm_manager_init (GsmManager *manager)
{
- gchar **schemas = NULL;
- gboolean schema_exists;
- guint i;
GsmManagerPrivate *priv;
priv = gsm_manager_get_instance_private (manager);
@@ -2846,23 +2814,6 @@ gsm_manager_init (GsmManager *manager)
priv->settings_session = g_settings_new (SESSION_SCHEMA);
priv->settings_lockdown = g_settings_new (LOCKDOWN_SCHEMA);
- /* check if mate-screensaver is installed */
- g_settings_schema_source_list_schemas (g_settings_schema_source_get_default (), TRUE, &schemas, NULL);
- schema_exists = FALSE;
- for (i = 0; schemas[i] != NULL; i++) {
- if (g_str_equal (schemas[i], SCREENSAVER_SCHEMA)) {
- schema_exists = TRUE;
- break;
- }
- }
-
- g_strfreev (schemas);
-
- if (schema_exists == TRUE)
- priv->settings_screensaver = g_settings_new (SCREENSAVER_SCHEMA);
- else
- priv->settings_screensaver = NULL;
-
priv->inhibitors = gsm_store_new ();
g_signal_connect (priv->inhibitors,
"added",
@@ -3294,7 +3245,7 @@ request_suspend (GsmManager *manager)
g_debug ("GsmManager: requesting suspend");
if (! gsm_manager_is_suspend_inhibited (manager)) {
- manager_attempt_suspend (manager);
+ manager_attempt_suspend ();
return;
}
@@ -3325,7 +3276,7 @@ request_hibernate (GsmManager *manager)
/* hibernate uses suspend inhibit */
if (! gsm_manager_is_suspend_inhibited (manager)) {
- manager_attempt_hibernate (manager);
+ manager_attempt_hibernate ();
return;
}
diff --git a/mate-session/gsm-util.c b/mate-session/gsm-util.c
index 76bf9cd..e25d166 100644
--- a/mate-session/gsm-util.c
+++ b/mate-session/gsm-util.c
@@ -42,7 +42,6 @@ gchar **
gsm_get_screen_locker_command (void)
{
const char *screen_locker_command[] = {
- "mate-screensaver-command --lock",
"xscreensaver-command -lock",
NULL
};