userMenu: Use the session id to detect the current session

This allows us to detect startx sessions.

https://bugzilla.gnome.org/show_bug.cgi?id=693896
This commit is contained in:
Adel Gadllah 2013-02-18 18:03:13 +01:00
parent 3430012136
commit e411a4af21

View File

@ -48,6 +48,7 @@ const IMStatus = {
const SystemdLoginSessionIface = <interface name='org.freedesktop.login1.Session'>
<property name="Id" type="s" access="read"/>
<property name="Remote" type="b" access="read"/>
<property name="Class" type="s" access="read"/>
<property name="Type" type="s" access="read"/>
@ -960,8 +961,7 @@ const UserMenuButton = new Lang.Class({
if (proxy.Class != "user")
continue;
if (userName == GLib.get_user_name() &&
!proxy.Remote && proxy.Type == "x11")
if (proxy.Id == GLib.getenv('XDG_SESSION_ID'))
continue;
sessions.push({ user: this._userManager.get_user(userName),