summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgusi <gusi@df743ca5-7f9a-e211-a948-0013205c9059>2014-10-25 01:42:03 +0800
committergusi <gusi@df743ca5-7f9a-e211-a948-0013205c9059>2014-10-25 01:42:03 +0800
commit8199038546d3dc824db54ffb036ead694dfed0eb (patch)
tree4ec95d8cc2af3d49e18718508c99c8fc6e7de90c
parent5598fa44939050ba4fc37af53b3c60a4af93fb22 (diff)
downloadmarcuscom-ports-8199038546d3dc824db54ffb036ead694dfed0eb.tar.gz
marcuscom-ports-8199038546d3dc824db54ffb036ead694dfed0eb.tar.zst
marcuscom-ports-8199038546d3dc824db54ffb036ead694dfed0eb.zip
Revert the removal of ConsoleKit support in gnome-shell. This would
allow gdm to login and properly keep track of the local active session of the user (ck-list-session would show the session as active and local). [1] https://bugzilla.gnome.org/show_bug.cgi?id=686626 Reported and contributed by: ajacoutot at Freenode#freebsd-gnome git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@20020 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r--x11/gnome-shell/Makefile3
-rw-r--r--x11/gnome-shell/files/patch-js_misc_loginManager.js110
2 files changed, 112 insertions, 1 deletions
diff --git a/x11/gnome-shell/Makefile b/x11/gnome-shell/Makefile
index 92fcb2eea..37061c0e6 100644
--- a/x11/gnome-shell/Makefile
+++ b/x11/gnome-shell/Makefile
@@ -1,9 +1,10 @@
# Created by: Pawel Worach <pawel.worach@gmail.com>
# $FreeBSD$
-# $MCom·
+# $MCom$
PORTNAME= gnome-shell
PORTVERSION= 3.14.1
+PORTREVISION= 1
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome3
diff --git a/x11/gnome-shell/files/patch-js_misc_loginManager.js b/x11/gnome-shell/files/patch-js_misc_loginManager.js
new file mode 100644
index 000000000..37aec6ba8
--- /dev/null
+++ b/x11/gnome-shell/files/patch-js_misc_loginManager.js
@@ -0,0 +1,110 @@
+--- js/misc/loginManager.js.orig 2014-10-13 22:57:05.000000000 +0200
++++ js/misc/loginManager.js 2014-10-23 19:53:12.854065483 +0200
+@@ -46,6 +46,32 @@
+ const SystemdLoginManager = Gio.DBusProxy.makeProxyWrapper(SystemdLoginManagerIface);
+ const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
+
++const ConsoleKitManagerIface = '<node> \
++<interface name="org.freedesktop.ConsoleKit.Manager"> \
++<method name="CanRestart"> \
++ <arg type="b" direction="out"/> \
++</method> \
++<method name="CanStop"> \
++ <arg type="b" direction="out"/> \
++</method> \
++<method name="Restart" /> \
++<method name="Stop" /> \
++<method name="GetCurrentSession"> \
++ <arg type="o" direction="out" /> \
++</method> \
++</interface> \
++</node>';
++
++const ConsoleKitSessionIface = '<node> \
++<interface name="org.freedesktop.ConsoleKit.Session"> \
++<signal name="Lock" /> \
++<signal name="Unlock" /> \
++</interface> \
++</node>';
++
++const ConsoleKitSession = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
++const ConsoleKitManager = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface);
++
+ function haveSystemd() {
+ return GLib.access("/run/systemd/seats", 0) >= 0;
+ }
+@@ -75,7 +101,7 @@
+ -1, null);
+
+ let version = result.deep_unpack()[0].deep_unpack();
+- return haveSystemd() && versionCompare('3.5.91', version);
++ return versionCompare('3.5.91', version);
+ } catch(e) {
+ return false;
+ }
+@@ -93,7 +119,7 @@
+ if (haveSystemd())
+ _loginManager = new LoginManagerSystemd();
+ else
+- _loginManager = new LoginManagerDummy();
++ _loginManager = new LoginManagerConsoleKit();
+ }
+
+ return _loginManager;
+@@ -110,6 +136,9 @@
+ Lang.bind(this, this._prepareForSleep));
+ },
+
++ // Having this function is a bit of a hack since the Systemd and ConsoleKit
++ // session objects have different interfaces - but in both cases there are
++ // Lock/Unlock signals, and that's all we count upon at the moment.
+ getCurrentSessionProxy: function(callback) {
+ if (this._currentSession) {
+ callback (this._currentSession);
+@@ -177,13 +206,35 @@
+ });
+ Signals.addSignalMethods(LoginManagerSystemd.prototype);
+
+-const LoginManagerDummy = new Lang.Class({
+- Name: 'LoginManagerDummy',
++const LoginManagerConsoleKit = new Lang.Class({
++ Name: 'LoginManagerConsoleKit',
++
++ _init: function() {
++ this._proxy = new ConsoleKitManager(Gio.DBus.system,
++ 'org.freedesktop.ConsoleKit',
++ '/org/freedesktop/ConsoleKit/Manager');
++ },
+
++ // Having this function is a bit of a hack since the Systemd and ConsoleKit
++ // session objects have different interfaces - but in both cases there are
++ // Lock/Unlock signals, and that's all we count upon at the moment.
+ getCurrentSessionProxy: function(callback) {
+- // we could return a DummySession object that fakes whatever callers
+- // expect (at the time of writing: connect() and connectSignal()
+- // methods), but just never calling the callback should be safer
++ if (this._currentSession) {
++ callback (this._currentSession);
++ return;
++ }
++
++ this._proxy.GetCurrentSessionRemote(Lang.bind(this,
++ function(result, error) {
++ if (error) {
++ logError(error, 'Could not get a proxy for the current session');
++ } else {
++ this._currentSession = new ConsoleKitSession(Gio.DBus.system,
++ 'org.freedesktop.ConsoleKit',
++ result[0]);
++ callback(this._currentSession);
++ }
++ }));
+ },
+
+ canSuspend: function(asyncCallback) {
+@@ -203,4 +254,4 @@
+ callback(null);
+ }
+ });
+-Signals.addSignalMethods(LoginManagerDummy.prototype);
++Signals.addSignalMethods(LoginManagerConsoleKit.prototype);