summaryrefslogtreecommitdiff
path: root/mate-session
diff options
context:
space:
mode:
Diffstat (limited to 'mate-session')
-rw-r--r--mate-session/gs-idle-monitor.c1
-rw-r--r--mate-session/gs-idle-monitor.h2
-rw-r--r--mate-session/gsm-app.c1
-rw-r--r--mate-session/gsm-app.h1
-rw-r--r--mate-session/gsm-autostart-app.c12
-rw-r--r--mate-session/gsm-autostart-app.h2
-rw-r--r--mate-session/gsm-client.c2
-rw-r--r--mate-session/gsm-client.h3
-rw-r--r--mate-session/gsm-consolekit.c6
-rw-r--r--mate-session/gsm-consolekit.h1
-rw-r--r--mate-session/gsm-dbus-client.c2
-rw-r--r--mate-session/gsm-dbus-client.h1
-rw-r--r--mate-session/gsm-inhibit-dialog.c31
-rw-r--r--mate-session/gsm-inhibit-dialog.h1
-rw-r--r--mate-session/gsm-inhibitor.c1
-rw-r--r--mate-session/gsm-inhibitor.h1
-rw-r--r--mate-session/gsm-logout-dialog.c1
-rw-r--r--mate-session/gsm-logout-dialog.h1
-rw-r--r--mate-session/gsm-manager.c62
-rw-r--r--mate-session/gsm-manager.h3
-rw-r--r--mate-session/gsm-presence.c1
-rw-r--r--mate-session/gsm-presence.h1
-rw-r--r--mate-session/gsm-session-save.c1
-rw-r--r--mate-session/gsm-session-save.h1
-rw-r--r--mate-session/gsm-store.c2
-rw-r--r--mate-session/gsm-store.h2
-rw-r--r--mate-session/gsm-systemd.c5
-rw-r--r--mate-session/gsm-systemd.h1
-rw-r--r--mate-session/gsm-util.c29
-rw-r--r--mate-session/gsm-util.h3
-rw-r--r--mate-session/gsm-xsmp-client.c8
-rw-r--r--mate-session/gsm-xsmp-client.h2
-rw-r--r--mate-session/gsm-xsmp-server.c8
-rw-r--r--mate-session/gsm-xsmp-server.h2
-rw-r--r--mate-session/main.c14
-rw-r--r--mate-session/mdm-log.c1
-rw-r--r--mate-session/mdm-log.h1
-rw-r--r--mate-session/mdm-signal-handler.c2
-rw-r--r--mate-session/mdm-signal-handler.h1
-rw-r--r--mate-session/mdm.c1
-rw-r--r--mate-session/mdm.h1
-rw-r--r--mate-session/msm-gnome.c7
-rw-r--r--mate-session/msm-gnome.h1
-rw-r--r--mate-session/test-client-dbus.c1
-rw-r--r--mate-session/test-inhibit.c1
45 files changed, 143 insertions, 89 deletions
diff --git a/mate-session/gs-idle-monitor.c b/mate-session/gs-idle-monitor.c
index a188af5..375cf5d 100644
--- a/mate-session/gs-idle-monitor.c
+++ b/mate-session/gs-idle-monitor.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/mate-session/gs-idle-monitor.h b/mate-session/gs-idle-monitor.h
index cf4be06..0eb316b 100644
--- a/mate-session/gs-idle-monitor.h
+++ b/mate-session/gs-idle-monitor.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,7 +47,6 @@ void gs_idle_monitor_remove_watch (GSIdleMonitor *monitor,
guint id);
void gs_idle_monitor_reset (GSIdleMonitor *monitor);
-
G_END_DECLS
#endif /* __GS_IDLE_MONITOR_H */
diff --git a/mate-session/gsm-app.c b/mate-session/gsm-app.c
index 7d693b8..6d7a058 100644
--- a/mate-session/gsm-app.c
+++ b/mate-session/gsm-app.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-app.h b/mate-session/gsm-app.h
index af7db2b..96a06d1 100644
--- a/mate-session/gsm-app.h
+++ b/mate-session/gsm-app.h
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-autostart-app.c b/mate-session/gsm-autostart-app.c
index 8c90759..079bfa1 100644
--- a/mate-session/gsm-autostart-app.c
+++ b/mate-session/gsm-autostart-app.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -114,16 +115,6 @@ is_disabled (GsmApp *app)
priv = gsm_autostart_app_get_instance_private (GSM_AUTOSTART_APP(app));
- /* GSM_AUTOSTART_APP_ENABLED_KEY key, used by old mate-session */
- if (egg_desktop_file_has_key (priv->desktop_file,
- GSM_AUTOSTART_APP_ENABLED_KEY, NULL) &&
- !egg_desktop_file_get_boolean (priv->desktop_file,
- GSM_AUTOSTART_APP_ENABLED_KEY, NULL)) {
- g_debug ("app %s is disabled by " GSM_AUTOSTART_APP_ENABLED_KEY,
- gsm_app_peek_id (app));
- return TRUE;
- }
-
/* Hidden key, used by autostart spec */
if (egg_desktop_file_get_boolean (priv->desktop_file,
EGG_DESKTOP_FILE_KEY_HIDDEN, NULL)) {
@@ -1063,7 +1054,6 @@ gsm_autostart_app_provides (GsmApp *app,
GsmAutostartApp *aapp;
GsmAutostartAppPrivate *priv;
-
g_return_val_if_fail (GSM_IS_APP (app), FALSE);
aapp = GSM_AUTOSTART_APP (app);
diff --git a/mate-session/gsm-autostart-app.h b/mate-session/gsm-autostart-app.h
index 48b2c48..c3a68d1 100644
--- a/mate-session/gsm-autostart-app.h
+++ b/mate-session/gsm-autostart-app.h
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -42,7 +43,6 @@ struct _GsmAutostartAppClass
GsmApp *gsm_autostart_app_new (const char *desktop_file);
-#define GSM_AUTOSTART_APP_ENABLED_KEY "X-MATE-Autostart-enabled"
#define GSM_AUTOSTART_APP_PHASE_KEY "X-MATE-Autostart-Phase"
#define GSM_AUTOSTART_APP_PROVIDES_KEY "X-MATE-Provides"
#define GSM_AUTOSTART_APP_STARTUP_ID_KEY "X-MATE-Autostart-startup-id"
diff --git a/mate-session/gsm-client.c b/mate-session/gsm-client.c
index 13c6169..8dc4005 100644
--- a/mate-session/gsm-client.c
+++ b/mate-session/gsm-client.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -525,7 +526,6 @@ gsm_client_cancel_end_session (GsmClient *client,
return GSM_CLIENT_GET_CLASS (client)->impl_cancel_end_session (client, error);
}
-
gboolean
gsm_client_query_end_session (GsmClient *client,
guint flags,
diff --git a/mate-session/gsm-client.h b/mate-session/gsm-client.h
index 0afff15..ff3012f 100644
--- a/mate-session/gsm-client.h
+++ b/mate-session/gsm-client.h
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -96,13 +97,11 @@ GQuark gsm_client_error_quark (void);
const char *gsm_client_peek_id (GsmClient *client);
-
const char * gsm_client_peek_startup_id (GsmClient *client);
const char * gsm_client_peek_app_id (GsmClient *client);
guint gsm_client_peek_restart_style_hint (GsmClient *client);
guint gsm_client_peek_status (GsmClient *client);
-
char *gsm_client_get_app_name (GsmClient *client);
void gsm_client_set_app_id (GsmClient *client,
const char *app_id);
diff --git a/mate-session/gsm-consolekit.c b/mate-session/gsm-consolekit.c
index 82e04a5..45101c8 100644
--- a/mate-session/gsm-consolekit.c
+++ b/mate-session/gsm-consolekit.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -244,7 +245,7 @@ gsm_consolekit_ensure_ck_connection (GsmConsolekit *manager,
out:
if (priv->is_connected != is_connected) {
- priv->is_connected = is_connected;
+ priv->is_connected = (is_connected != FALSE);
g_object_notify (G_OBJECT (manager), "is-connected");
}
@@ -544,7 +545,6 @@ gsm_consolekit_attempt_hibernate (GsmConsolekit *manager)
G_TYPE_INVALID,
G_TYPE_INVALID);
-
if (!res) {
g_warning ("Unable to hibernate system: %s", error->message);
g_error_free (error);
@@ -709,7 +709,6 @@ gsm_consolekit_set_session_idle (GsmConsolekit *manager,
goto out;
}
-
g_debug ("Updating ConsoleKit idle status: %d", is_idle);
message = dbus_message_new_method_call (CK_NAME,
session_id,
@@ -1064,7 +1063,6 @@ out:
return ret;
}
-
GsmConsolekit *
gsm_get_consolekit (void)
{
diff --git a/mate-session/gsm-consolekit.h b/mate-session/gsm-consolekit.h
index ce4a821..c41f92a 100644
--- a/mate-session/gsm-consolekit.h
+++ b/mate-session/gsm-consolekit.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-dbus-client.c b/mate-session/gsm-dbus-client.c
index eba098c..69d723a 100644
--- a/mate-session/gsm-dbus-client.c
+++ b/mate-session/gsm-dbus-client.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -189,7 +190,6 @@ handle_end_session_response (GsmDBusClient *client,
gsm_client_end_session_response (GSM_CLIENT (client),
is_ok, FALSE, FALSE, reason);
-
if (! dbus_connection_send (client->connection, reply, NULL)) {
g_error ("No memory");
}
diff --git a/mate-session/gsm-dbus-client.h b/mate-session/gsm-dbus-client.h
index a1007cc..c264c92 100644
--- a/mate-session/gsm-dbus-client.h
+++ b/mate-session/gsm-dbus-client.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-inhibit-dialog.c b/mate-session/gsm-inhibit-dialog.c
index a4e86e8..791a7b3 100644
--- a/mate-session/gsm-inhibit-dialog.c
+++ b/mate-session/gsm-inhibit-dialog.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -91,13 +92,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
@@ -268,7 +281,6 @@ _load_icon (GtkIconTheme *icon_theme,
return retval;
}
-
static GdkPixbuf *
scale_pixbuf (GdkPixbuf *pixbuf,
int max_width,
@@ -296,8 +308,8 @@ scale_pixbuf (GdkPixbuf *pixbuf,
/* always scale down, allow to disable scaling up */
if (scale_factor < 1.0 || !no_stretch_hint) {
- int scale_x = (int) (pw * scale_factor);
- int scale_y = (int) (ph * scale_factor);
+ int scale_x = (int) (scale_factor * (float) pw);
+ int scale_y = (int) (scale_factor * (float) ph);
g_debug ("Scaling to %dx%d", scale_x, scale_y);
return gdk_pixbuf_scale_simple (pixbuf,
scale_x,
@@ -721,7 +733,6 @@ gsm_inhibit_dialog_set_inhibitor_store (GsmInhibitDialog *dialog,
g_object_unref (dialog->inhibitors);
}
-
g_debug ("GsmInhibitDialog: setting store %p", store);
dialog->inhibitors = store;
diff --git a/mate-session/gsm-inhibit-dialog.h b/mate-session/gsm-inhibit-dialog.h
index 89c7121..313b493 100644
--- a/mate-session/gsm-inhibit-dialog.h
+++ b/mate-session/gsm-inhibit-dialog.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/mate-session/gsm-inhibitor.c b/mate-session/gsm-inhibitor.c
index 6129ddb..8632c15 100644
--- a/mate-session/gsm-inhibitor.c
+++ b/mate-session/gsm-inhibitor.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-inhibitor.h b/mate-session/gsm-inhibitor.h
index 653f717..a4d20e9 100644
--- a/mate-session/gsm-inhibitor.h
+++ b/mate-session/gsm-inhibitor.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-logout-dialog.c b/mate-session/gsm-logout-dialog.c
index a775283..35f36e2 100644
--- a/mate-session/gsm-logout-dialog.c
+++ b/mate-session/gsm-logout-dialog.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2006 Vincent Untz
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-logout-dialog.h b/mate-session/gsm-logout-dialog.h
index 2166521..686af38 100644
--- a/mate-session/gsm-logout-dialog.h
+++ b/mate-session/gsm-logout-dialog.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2006 Vincent Untz
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index 9b0200f..37ca39d 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -3,6 +3,7 @@
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
* Copyright (C) 2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -82,7 +83,6 @@
#define GDM_FLEXISERVER_COMMAND "gdmflexiserver"
#define GDM_FLEXISERVER_ARGS "--startnew Standard"
-
#define LOCKDOWN_SCHEMA "org.mate.lockdown"
#define KEY_LOCK_DISABLE "disable-lock-screen"
#define KEY_LOG_OUT_DISABLE "disable-log-out"
@@ -144,7 +144,7 @@ typedef struct {
GSettings *settings_lockdown;
GSettings *settings_screensaver;
- const char *renderer;
+ char *renderer;
DBusGProxy *bus_proxy;
DBusGConnection *connection;
@@ -767,7 +767,6 @@ typedef struct {
guint flags;
} ClientEndSessionData;
-
static gboolean
_client_end_session (GsmClient *client,
ClientEndSessionData *data)
@@ -1224,21 +1223,34 @@ sleep_lock_is_enabled (GsmManager *manager)
static void
manager_perhaps_lock (GsmManager *manager)
{
- GError *error;
- gboolean ret;
+ gchar **screen_locker_command;
- /* only lock if mate-screensaver is set to lock */
- if (!sleep_lock_is_enabled (manager)) {
- return;
- }
+ if ((screen_locker_command = gsm_get_screen_locker_command ()) != NULL) {
+ GError *error = NULL;
- /* do this sync to ensure it's on the screen when we start suspending */
- error = NULL;
- ret = g_spawn_command_line_sync ("mate-screensaver-command --lock", NULL, NULL, NULL, &error);
- if (!ret) {
- g_warning ("Couldn't lock screen: %s", error->message);
- g_error_free (error);
+ /* 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 | G_SPAWN_SEARCH_PATH,
+ NULL, NULL, NULL, NULL, NULL, &error);
+
+ if (error) {
+ g_warning ("Couldn't lock screen: %s", error->message);
+ g_error_free (error);
+ }
+
+ } else {
+ g_warning ("Couldn't find any screen locker");
}
+
+clear_screen_locker_command:
+
+ g_strfreev (screen_locker_command);
}
static void
@@ -1683,7 +1695,8 @@ _gsm_manager_set_renderer (GsmManager *manager,
{
GsmManagerPrivate *priv;
priv = gsm_manager_get_instance_private (manager);
- priv->renderer = renderer;
+ g_free (priv->renderer);
+ priv->renderer = g_strdup (renderer);
}
static gboolean
@@ -1863,7 +1876,6 @@ _disconnect_client (GsmManager *manager,
goto out;
}
-
if (app == NULL) {
g_debug ("GsmManager: unable to find application for client - not restarting");
goto out;
@@ -2172,13 +2184,13 @@ on_xsmp_client_register_request (GsmXSMPClient *client,
if (IS_STRING_EMPTY (*id)) {
new_id = gsm_util_generate_startup_id ();
} else {
- GsmClient *client;
+ GsmClient *sm_client;
- client = (GsmClient *)gsm_store_find (priv->clients,
- (GsmStoreFunc)_client_has_startup_id,
- *id);
+ sm_client = (GsmClient *)gsm_store_find (priv->clients,
+ (GsmStoreFunc)_client_has_startup_id,
+ *id);
/* We can't have two clients with the same id. */
- if (client != NULL) {
+ if (sm_client != NULL) {
goto out;
}
@@ -2480,7 +2492,6 @@ gsm_manager_set_client_store (GsmManager *manager,
g_object_unref (priv->clients);
}
-
g_debug ("GsmManager: setting client store %p", store);
priv->clients = store;
@@ -2646,6 +2657,9 @@ gsm_manager_dispose (GObject *object)
g_object_unref (priv->settings_screensaver);
priv->settings_screensaver = NULL;
}
+
+ g_clear_pointer (&priv->renderer, g_free);
+
G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
}
@@ -3335,7 +3349,6 @@ request_hibernate (GsmManager *manager)
gtk_widget_show (priv->inhibit_dialog);
}
-
static void
request_logout (GsmManager *manager,
GsmManagerLogoutMode mode)
@@ -4079,7 +4092,6 @@ gsm_manager_get_inhibitors (GsmManager *manager,
return TRUE;
}
-
static gboolean
_app_has_autostart_condition (const char *id,
GsmApp *app,
diff --git a/mate-session/gsm-manager.h b/mate-session/gsm-manager.h
index 36575ee..4c0cb54 100644
--- a/mate-session/gsm-manager.h
+++ b/mate-session/gsm-manager.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,6 @@
*
*/
-
#ifndef __GSM_MANAGER_H
#define __GSM_MANAGER_H
@@ -112,7 +112,6 @@ gboolean gsm_manager_add_legacy_session_apps (GsmManager *
void gsm_manager_start (GsmManager *manager);
-
/* exported methods */
gboolean gsm_manager_register_client (GsmManager *manager,
diff --git a/mate-session/gsm-presence.c b/mate-session/gsm-presence.c
index 1e1d602..7fc2304 100644
--- a/mate-session/gsm-presence.c
+++ b/mate-session/gsm-presence.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-presence.h b/mate-session/gsm-presence.h
index 36041ff..27d611b 100644
--- a/mate-session/gsm-presence.h
+++ b/mate-session/gsm-presence.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-session-save.c b/mate-session/gsm-session-save.c
index 67d9945..4c88f08 100644
--- a/mate-session/gsm-session-save.c
+++ b/mate-session/gsm-session-save.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
* gsm-session-save.c
* Copyright (C) 2008 Lucas Rocha.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-session-save.h b/mate-session/gsm-session-save.h
index 4e0cf47..3d8b837 100644
--- a/mate-session/gsm-session-save.h
+++ b/mate-session/gsm-session-save.h
@@ -1,5 +1,6 @@
/* gsm-session-save.h
* Copyright (C) 2008 Lucas Rocha.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-store.c b/mate-session/gsm-store.c
index 67d6520..6a62805 100644
--- a/mate-session/gsm-store.c
+++ b/mate-session/gsm-store.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007-2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -155,7 +156,6 @@ gsm_store_lookup (GsmStore *store,
return object;
}
-
typedef struct
{
GsmStoreFunc func;
diff --git a/mate-session/gsm-store.h b/mate-session/gsm-store.h
index 94da2f7..fe1b1a5 100644
--- a/mate-session/gsm-store.h
+++ b/mate-session/gsm-store.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007-2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,6 @@
*
*/
-
#ifndef __GSM_STORE_H
#define __GSM_STORE_H
diff --git a/mate-session/gsm-systemd.c b/mate-session/gsm-systemd.c
index 1ef7ddf..74def27 100644
--- a/mate-session/gsm-systemd.c
+++ b/mate-session/gsm-systemd.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 Stefano Karapetsas <[email protected]>
+ * Copyright (C) 2013-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -244,7 +245,7 @@ gsm_systemd_ensure_sd_connection (GsmSystemd *manager,
out:
if (priv->is_connected != is_connected) {
- priv->is_connected = is_connected;
+ priv->is_connected = (is_connected != FALSE);
g_object_notify (G_OBJECT (manager), "is-connected");
}
@@ -632,7 +633,6 @@ out:
}
}
-
void
gsm_systemd_set_session_idle (GsmSystemd *manager,
gboolean is_idle)
@@ -1008,7 +1008,6 @@ gsm_systemd_get_current_session_type (GsmSystemd *manager)
return session_class;
}
-
GsmSystemd *
gsm_get_systemd (void)
{
diff --git a/mate-session/gsm-systemd.h b/mate-session/gsm-systemd.h
index 9522709..5ee663b 100644
--- a/mate-session/gsm-systemd.h
+++ b/mate-session/gsm-systemd.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 Stefano Karapetsas
+ * Copyright (C) 2013-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/gsm-util.c b/mate-session/gsm-util.c
index a769d8c..a760fc3 100644
--- a/mate-session/gsm-util.c
+++ b/mate-session/gsm-util.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
* gsm-util.c
* Copyright (C) 2008 Lucas Rocha.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -38,6 +39,33 @@
static gchar *_saved_session_dir = NULL;
+gchar **
+gsm_get_screen_locker_command (void)
+{
+ const char *screen_locker_command[] = {
+ "mate-screensaver-command --lock",
+ "xscreensaver-command -lock",
+ NULL
+ };
+ gchar **screen_locker_argv = NULL;
+ gsize i;
+
+ for (i = 0; screen_locker_command[i] != NULL && screen_locker_argv == NULL; i++) {
+ gchar **argv;
+ char *path;
+
+ argv = g_strsplit (screen_locker_command [i], " ", -1);
+ path = g_find_program_in_path (argv[0]);
+ if (path)
+ screen_locker_argv = g_strdupv (argv);
+
+ g_free (path);
+ g_strfreev (argv);
+ }
+
+ return screen_locker_argv;
+}
+
char *
gsm_util_find_desktop_file_for_app_name (const char *name,
char **autostart_dirs)
@@ -207,7 +235,6 @@ gsm_util_get_saved_session_dir (void)
return _saved_session_dir;
}
-
char **
gsm_util_get_autostart_dirs ()
{
diff --git a/mate-session/gsm-util.h b/mate-session/gsm-util.h
index dcec60e..fc76fef 100644
--- a/mate-session/gsm-util.h
+++ b/mate-session/gsm-util.h
@@ -1,5 +1,6 @@
/* gsm-util.h
* Copyright (C) 2008 Lucas Rocha.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -29,6 +30,8 @@ extern "C" {
#define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
+gchar** gsm_get_screen_locker_command (void);
+
char * gsm_util_find_desktop_file_for_app_name (const char *app_name,
char **dirs);
diff --git a/mate-session/gsm-xsmp-client.c b/mate-session/gsm-xsmp-client.c
index 5e15744..bffecac 100644
--- a/mate-session/gsm-xsmp-client.c
+++ b/mate-session/gsm-xsmp-client.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -214,7 +215,6 @@ gsm_xsmp_client_init (GsmXSMPClient *client)
priv->next_save_yourself_allow_interact = FALSE;
}
-
static void
delete_property (GsmXSMPClient *client,
const char *name)
@@ -247,7 +247,6 @@ delete_property (GsmXSMPClient *client,
SmFreeProperty (prop);
}
-
static void
debug_print_property (SmProp *prop)
{
@@ -279,7 +278,6 @@ debug_print_property (SmProp *prop)
}
}
-
static void
set_properties_callback (SmsConn conn,
SmPointer manager_data,
@@ -441,7 +439,7 @@ do_save_yourself (GsmXSMPClient *client,
g_debug ("GsmXSMPClient: queuing new SaveYourself for '%s'",
priv->description);
priv->next_save_yourself = save_type;
- priv->next_save_yourself_allow_interact = allow_interact;
+ priv->next_save_yourself_allow_interact = (allow_interact != FALSE);
} else {
priv->current_save_yourself = save_type;
/* make sure we don't have anything queued */
@@ -1105,7 +1103,6 @@ register_client_callback (SmsConn conn,
priv->description,
previous_id ? previous_id : "NULL");
-
/* There are three cases:
* 1. id is NULL - we'll use a new one
* 2. id is known - we'll use known one
@@ -1152,7 +1149,6 @@ register_client_callback (SmsConn conn,
return TRUE;
}
-
static void
save_yourself_request_callback (SmsConn conn,
SmPointer manager_data,
diff --git a/mate-session/gsm-xsmp-client.h b/mate-session/gsm-xsmp-client.h
index d080948..917cf91 100644
--- a/mate-session/gsm-xsmp-client.h
+++ b/mate-session/gsm-xsmp-client.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 Novell, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -40,7 +41,6 @@ struct _GsmXSMPClientClass
gboolean (*logout_request) (GsmXSMPClient *client,
gboolean prompt);
-
void (*saved_state) (GsmXSMPClient *client);
void (*request_phase2) (GsmXSMPClient *client);
diff --git a/mate-session/gsm-xsmp-server.c b/mate-session/gsm-xsmp-server.c
index 1566aba..719d65c 100644
--- a/mate-session/gsm-xsmp-server.c
+++ b/mate-session/gsm-xsmp-server.c
@@ -3,6 +3,7 @@
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
* Copyright (C) 2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -509,9 +510,9 @@ update_iceauthority (GsmXsmpServer *server,
}
for (e = entries; e; e = e->next) {
- IceAuthFileEntry *auth_entry = e->data;
- IceWriteAuthFileEntry (fp, auth_entry);
- IceFreeAuthFileEntry (auth_entry);
+ IceAuthFileEntry *auth_file_entry = e->data;
+ IceWriteAuthFileEntry (fp, auth_file_entry);
+ IceFreeAuthFileEntry (auth_file_entry);
}
g_slist_free (entries);
@@ -528,7 +529,6 @@ update_iceauthority (GsmXsmpServer *server,
return ok;
}
-
static void
setup_listener (GsmXsmpServer *server)
{
diff --git a/mate-session/gsm-xsmp-server.h b/mate-session/gsm-xsmp-server.h
index 29f72db..2e1f934 100644
--- a/mate-session/gsm-xsmp-server.h
+++ b/mate-session/gsm-xsmp-server.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +19,6 @@
*
*/
-
#ifndef __GSM_XSMP_SERVER_H
#define __GSM_XSMP_SERVER_H
diff --git a/mate-session/main.c b/mate-session/main.c
index 56795ac..68e3864 100644
--- a/mate-session/main.c
+++ b/mate-session/main.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2006 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -21,7 +22,6 @@
#include <config.h>
-#include <libintl.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
@@ -83,7 +83,6 @@ static gboolean failsafe = FALSE;
static gboolean show_version = FALSE;
static gboolean debug = FALSE;
static gboolean disable_acceleration_check = FALSE;
-static char *gl_renderer = NULL;
static gboolean
initialize_gsettings (void)
@@ -575,7 +574,7 @@ static void set_overlay_scroll (void)
}
static gboolean
-check_gl (GError **error)
+check_gl (gchar **gl_renderer, GError **error)
{
int status;
char *argv[] = { LIBEXECDIR "/mate-session-check-accelerated", NULL };
@@ -585,7 +584,7 @@ check_gl (GError **error)
return TRUE;
}
- if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL, &gl_renderer, NULL,
+ if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL, gl_renderer, NULL,
&status, error)) {
return FALSE;
}
@@ -605,6 +604,7 @@ int main(int argc, char** argv)
GSettings* accessibility_settings;
MdmSignalHandler* signal_handler;
static char** override_autostart_dirs = NULL;
+ char* gl_renderer = NULL;
gboolean gl_failed = FALSE;
static GOptionEntry entries[] = {
@@ -622,9 +622,11 @@ int main(int argc, char** argv)
gsm_util_init_error(TRUE, "%s", error->message);
}
+#ifdef ENABLE_NLS
bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
@@ -668,7 +670,7 @@ int main(int argc, char** argv)
g_debug ("hardware acceleration check is disabled");
} else {
/* Check GL, if it doesn't work out then force software fallback */
- if (!check_gl (&error)) {
+ if (!check_gl (&gl_renderer, &error)) {
gl_failed = TRUE;
g_debug ("hardware acceleration check failed: %s",
@@ -676,7 +678,7 @@ int main(int argc, char** argv)
g_clear_error (&error);
if (g_getenv ("LIBGL_ALWAYS_SOFTWARE") == NULL) {
g_setenv ("LIBGL_ALWAYS_SOFTWARE", "1", TRUE);
- if (!check_gl (&error)) {
+ if (!check_gl (&gl_renderer, &error)) {
g_warning ("software acceleration check failed: %s",
error? error->message : "");
g_clear_error (&error);
diff --git a/mate-session/mdm-log.c b/mate-session/mdm-log.c
index 021060d..7195d74 100644
--- a/mate-session/mdm-log.c
+++ b/mate-session/mdm-log.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/mate-session/mdm-log.h b/mate-session/mdm-log.h
index 9e78449..eee6c29 100644
--- a/mate-session/mdm-log.h
+++ b/mate-session/mdm-log.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/mate-session/mdm-signal-handler.c b/mate-session/mdm-signal-handler.c
index 56287b2..dd03087 100644
--- a/mate-session/mdm-signal-handler.c
+++ b/mate-session/mdm-signal-handler.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2006 Red Hat, Inc.
* Copyright (C) 2007 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -232,7 +233,6 @@ static gboolean crashlogger_get_backtrace(void)
return success;
}
-
static void mdm_signal_handler_backtrace(void)
{
struct stat s;
diff --git a/mate-session/mdm-signal-handler.h b/mate-session/mdm-signal-handler.h
index dd4dc04..6fca4f7 100644
--- a/mate-session/mdm-signal-handler.h
+++ b/mate-session/mdm-signal-handler.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/mate-session/mdm.c b/mate-session/mdm.c
index 2e0e712..cef3755 100644
--- a/mate-session/mdm.c
+++ b/mate-session/mdm.c
@@ -4,6 +4,7 @@
* Copyright (C) 2005 Red Hat, Inc.
* Copyright (C) 2002, 2003 George Lebl
* Copyright (C) 2001 Queen of England,
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/mdm.h b/mate-session/mdm.h
index 4eec264..5f7eed8 100644
--- a/mate-session/mdm.h
+++ b/mate-session/mdm.h
@@ -3,6 +3,7 @@
* Copyright (C) 2005 Red Hat, Inc.
* Copyright (C) 2002, 2003 George Lebl
* Copyright (C) 2001 Queen of England,
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
index b43f1ad..ce47b72 100644
--- a/mate-session/msm-gnome.c
+++ b/mate-session/msm-gnome.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2004-2005 Benedikt Meurer <[email protected]>
* 2013 Stefano Karapetsas <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,7 +47,6 @@
#define GNOME_KEYRING_DAEMON "gnome-keyring-daemon"
-
static gboolean gnome_compat_started = FALSE;
static Window gnome_smproxy_window = None;
@@ -90,8 +90,6 @@ gnome_keyring_daemon_startup (void)
g_child_watch_add (pid, gnome_keyring_daemon_finished, NULL);
}
-
-
static void
msm_compat_gnome_smproxy_startup (void)
{
@@ -128,7 +126,6 @@ msm_compat_gnome_smproxy_startup (void)
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
}
-
static void
msm_compat_gnome_smproxy_shutdown (void)
{
@@ -146,7 +143,6 @@ msm_compat_gnome_smproxy_shutdown (void)
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
}
-
void
msm_gnome_start (void)
{
@@ -181,7 +177,6 @@ msm_gnome_start (void)
g_object_unref (settings);
}
-
void
msm_gnome_stop (void)
{
diff --git a/mate-session/msm-gnome.h b/mate-session/msm-gnome.h
index e3c2e60..b658ba2 100644
--- a/mate-session/msm-gnome.h
+++ b/mate-session/msm-gnome.h
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2004 Benedikt Meurer <[email protected]>
* 2013 Stefano Karapetsas <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/mate-session/test-client-dbus.c b/mate-session/test-client-dbus.c
index ccb40b1..6b3afc5 100644
--- a/mate-session/test-client-dbus.c
+++ b/mate-session/test-client-dbus.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/mate-session/test-inhibit.c b/mate-session/test-inhibit.c
index 7207cb9..8c9f694 100644
--- a/mate-session/test-inhibit.c
+++ b/mate-session/test-inhibit.c
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as