7204N/ARestore support for ConsoleKit as an alternative to requiring systemd.
7204N/A
7204N/ANot suitable for upstream as they deprecated & removed ConsoleKit support.
7204N/A
7204N/A--- gnome-shell-3.18.0/js/misc/loginManager.js Mon Nov 2 12:49:09 2015
7204N/A+++ gnome-shell-3.18.0/js/misc/loginManager.js Mon Nov 2 12:51:59 2015
7204N/A@@ -46,6 +46,33 @@
7204N/A const SystemdLoginManager = Gio.DBusProxy.makeProxyWrapper(SystemdLoginManagerIface);
7204N/A const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
7204N/A
7204N/A+const ConsoleKitManagerIface = '<node> \
7204N/A+<interface name="org.freedesktop.ConsoleKit.Manager"> \
7204N/A+<method name="CanRestart"> \
7204N/A+ <arg type="b" direction="out"/> \
7204N/A+</method> \
7204N/A+<method name="CanStop"> \
7204N/A+ <arg type="b" direction="out"/> \
7204N/A+</method> \
7204N/A+<method name="Restart" /> \
7204N/A+<method name="Stop" /> \
7204N/A+<method name="GetCurrentSession"> \
7204N/A+ <arg type="o" direction="out" /> \
7204N/A+</method> \
7204N/A+</interface> \
7204N/A+</node>';
7204N/A+
7204N/A+const ConsoleKitSessionIface = '<node> \
7204N/A+<interface name="org.freedesktop.ConsoleKit.Session"> \
7204N/A+<signal name="Lock" /> \
7204N/A+<signal name="Unlock" /> \
7204N/A+</interface> \
7204N/A+</node>';
7204N/A+
7204N/A+const ConsoleKitSession = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
7204N/A+const ConsoleKitManager = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface);
7204N/A+
7204N/A+
7204N/A function haveSystemd() {
7204N/A return GLib.access("/run/systemd/seats", 0) >= 0;
7204N/A }
7204N/A@@ -75,7 +102,7 @@
7204N/A -1, null);
7204N/A
7204N/A let version = result.deep_unpack()[0].deep_unpack();
7204N/A- return haveSystemd() && versionCompare('3.5.91', version);
7204N/A+ return versionCompare('3.5.91', version);
7204N/A } catch(e) {
7204N/A return false;
7204N/A }
7204N/A@@ -93,7 +120,7 @@
7204N/A if (haveSystemd())
7204N/A _loginManager = new LoginManagerSystemd();
7204N/A else
7204N/A- _loginManager = new LoginManagerDummy();
7204N/A+ _loginManager = new LoginManagerConsoleKit();
7204N/A }
7204N/A
7204N/A return _loginManager;
7204N/A@@ -177,10 +204,35 @@
7204N/A });
7204N/A Signals.addSignalMethods(LoginManagerSystemd.prototype);
7204N/A
7204N/A-const LoginManagerDummy = new Lang.Class({
7204N/A- Name: 'LoginManagerDummy',
7204N/A+const LoginManagerConsoleKit = new Lang.Class({
7204N/A+ Name: 'LoginManagerConsoleKit',
7204N/A
7204N/A+ _init: function() {
7204N/A+ this._proxy = new ConsoleKitManager(Gio.DBus.system,
7204N/A+ 'org.freedesktop.ConsoleKit',
7204N/A+ '/org/freedesktop/ConsoleKit/Manager');
7204N/A+ },
7204N/A+
7204N/A+ // Having this function is a bit of a hack since the Systemd and ConsoleKit
7204N/A+ // session objects have different interfaces - but in both cases there are
7204N/A+ // Lock/Unlock signals, and that's all we count upon at the moment.
7204N/A getCurrentSessionProxy: function(callback) {
7204N/A+ if (this._currentSession) {
7204N/A+ callback (this._currentSession);
7204N/A+ return;
7204N/A+ }
7204N/A+
7204N/A+ this._proxy.GetCurrentSessionRemote(Lang.bind(this,
7204N/A+ function(result, error) {
7204N/A+ if (error) {
7204N/A+ logError(error, 'Could not get a proxy for the current session');
7204N/A+ } else {
7204N/A+ this._currentSession = new ConsoleKitSession(Gio.DBus.system,
7204N/A+ 'org.freedesktop.ConsoleKit',
7204N/A+ result[0]);
7204N/A+ callback(this._currentSession);
7204N/A+ }
7204N/A+ }));
7204N/A // we could return a DummySession object that fakes whatever callers
7204N/A // expect (at the time of writing: connect() and connectSignal()
7204N/A // methods), but just never calling the callback should be safer
7204N/A@@ -203,4 +255,4 @@
7204N/A callback(null);
7204N/A }
7204N/A });
7204N/A-Signals.addSignalMethods(LoginManagerDummy.prototype);
7204N/A+Signals.addSignalMethods(LoginManagerConsoleKit.prototype);