Remove org.freedesktop.ScreenSaver interface (#911)

This commit is contained in:
David Hewitt 2020-08-27 18:02:59 +01:00 committed by GitHub
parent 03fae35d74
commit a00b6257a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 51 deletions

View File

@ -64,19 +64,11 @@ namespace Gala {
unowned WindowManagerGala? gala_wm = wm as WindowManagerGala;
if (gala_wm != null) {
var screensaver_manager = gala_wm.screensaver;
Bus.own_name (BusType.SESSION, "org.freedesktop.ScreenSaver", BusNameOwnerFlags.REPLACE,
(connection) => {
try {
connection.register_object ("/org/freedesktop/ScreenSaver", screensaver_manager);
} catch (Error e) { warning (e.message); }
},
() => {},
() => critical ("Could not acquire freedesktop ScreenSaver bus") );
Bus.own_name (BusType.SESSION, "org.gnome.ScreenSaver", BusNameOwnerFlags.REPLACE,
(connection) => {
try {
connection.register_object ("/org/gnome/ScreenSaver", screensaver_manager.gnome_manager);
connection.register_object ("/org/gnome/ScreenSaver", screensaver_manager);
} catch (Error e) { warning (e.message); }
},
() => {},

View File

@ -16,13 +16,10 @@
//
namespace Gala {
[DBus (name="org.freedesktop.ScreenSaver")]
[DBus (name="org.gnome.ScreenSaver")]
public class ScreenSaverManager : Object {
public signal void active_changed (bool new_value);
[DBus (visible = false)]
public GNOMEScreenSaverManager gnome_manager { get; construct; }
[DBus (visible = false)]
public ScreenShield screen_shield { get; construct; }
@ -31,10 +28,8 @@ namespace Gala {
}
construct {
gnome_manager = new GNOMEScreenSaverManager (this);
screen_shield.active_changed.connect (() => {
active_changed (screen_shield.active);
gnome_manager.active_changed (screen_shield.active);
});
}
@ -63,40 +58,4 @@ namespace Gala {
}
}
}
[DBus (name="org.gnome.ScreenSaver")]
public class GNOMEScreenSaverManager : GLib.Object {
[DBus (visible = false)]
public weak ScreenSaverManager manager { get; construct; }
public signal void active_changed (bool new_value);
public signal void wake_up_screen ();
public GNOMEScreenSaverManager (ScreenSaverManager manager) {
Object (manager: manager);
}
construct {
manager.screen_shield.wake_up_screen.connect (() => {
wake_up_screen ();
});
}
public new void @lock () throws GLib.Error {
manager.@lock ();
}
public new bool get_active () throws GLib.Error {
return manager.get_active ();
}
public new void set_active (bool active) throws GLib.Error {
manager.set_active (active);
}
public new uint get_active_time () throws GLib.Error {
return manager.get_active_time ();
}
}
}