aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-12 23:43:14 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-12 23:43:14 +0200
commitf4e287ab8949b95148328ba0ddd10c69ba63dfba (patch)
treeb2b00b0e90389f1681392bd8dfd383b1ac85d960
parentc14dee80912b7c1a75bc18b2e5fa83469928a323 (diff)
downloadarctica-greeter-f4e287ab8949b95148328ba0ddd10c69ba63dfba.tar.gz
arctica-greeter-f4e287ab8949b95148328ba0ddd10c69ba63dfba.tar.bz2
arctica-greeter-f4e287ab8949b95148328ba0ddd10c69ba63dfba.zip
src/settings-daemon.vala: Also mimick org.mate.ScreenSaver D-Bus service.
-rw-r--r--src/settings-daemon.vala42
1 files changed, 36 insertions, 6 deletions
diff --git a/src/settings-daemon.vala b/src/settings-daemon.vala
index be34e9c..d8766d5 100644
--- a/src/settings-daemon.vala
+++ b/src/settings-daemon.vala
@@ -25,9 +25,10 @@ public class SettingsDaemon : Object
{
private int sd_pid = 0;
private int logind_inhibit_fd = -1;
- private ScreenSaverInterface screen_saver;
+ private GnomeScreenSaverInterface gnome_screen_saver;
+ private MateScreenSaverInterface mate_screen_saver;
private SessionManagerInterface session_manager;
- private int n_names = 2;
+ private int n_names = 3;
public void start ()
{
@@ -83,14 +84,15 @@ public class SettingsDaemon : Object
* the event to trigger this (which actually comes from mate-session).
* We implement the mate-screensaver interface and start the settings
* daemon once it is registered on the bus so mate-screensaver is not
- * started when it accesses this interface */
- screen_saver = new ScreenSaverInterface ();
+ * started when it accesses this interface.
+ */
+ gnome_screen_saver = new GnomeScreenSaverInterface ();
GLib.Bus.own_name (BusType.SESSION, "org.gnome.ScreenSaver", BusNameOwnerFlags.NONE,
(c) =>
{
try
{
- c.register_object ("/org/gnome/ScreenSaver", screen_saver);
+ c.register_object ("/org/gnome/ScreenSaver", gnome_screen_saver);
}
catch (Error e)
{
@@ -104,6 +106,29 @@ public class SettingsDaemon : Object
},
() => debug ("Failed to acquire name org.gnome.ScreenSaver"));
+ /* MATE components (e.g. mate-notification-daemon) expect org.mate.ScreenSaver being
+ * available. Mimick it so that the real mate-screensaver won't come up.
+ */
+ mate_screen_saver = new MateScreenSaverInterface ();
+ GLib.Bus.own_name (BusType.SESSION, "org.mate.ScreenSaver", BusNameOwnerFlags.NONE,
+ (c) =>
+ {
+ try
+ {
+ c.register_object ("/org/mate/ScreenSaver", mate_screen_saver);
+ }
+ catch (Error e)
+ {
+ warning ("Failed to register /org/mate/ScreenSaver: %s", e.message);
+ }
+ },
+ () =>
+ {
+ debug ("Acquired org.mate.ScreenSaver");
+ start_settings_daemon ();
+ },
+ () => debug ("Failed to acquire name org.mate.ScreenSaver"));
+
/* The media-keys plugin inhibits the power key, but we don't want
all the other keys doing things. So inhibit it ourselves */
/* NOTE: We are using the synchronous method here since there is a bug in Vala/GLib in that
@@ -203,7 +228,6 @@ public class SettingsDaemon : Object
}
-[DBus (name="org.gnome.ScreenSaver")]
public class ScreenSaverInterface : Object
{
public signal void active_changed (bool value);
@@ -283,6 +307,12 @@ public class ScreenSaverInterface : Object
public void simulate_user_activity () throws GLib.DBusError, GLib.IOError {}
}
+[DBus (name="org.gnome.ScreenSaver")]
+public class GnomeScreenSaverInterface : ScreenSaverInterface {}
+
+[DBus (name="org.mate.ScreenSaver")]
+public class MateScreenSaverInterface : ScreenSaverInterface {}
+
[DBus (name="org.gnome.SessionManager")]
public class SessionManagerInterface : Object
{