ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #03716
[Merge] lp:~mterry/indicator-session/lightdm-updates into lp:indicator-session
Michael Terry has proposed merging lp:~mterry/indicator-session/lightdm-updates into lp:indicator-session.
Requested reviews:
Indicator Applet Developers (indicator-applet-developers)
For more details, see:
https://code.launchpad.net/~mterry/indicator-session/lightdm-updates/+merge/69686
LightDM's exposed org.freedesktop.DisplayManager interface seems to have changed. Here's the updates needed to make switching work.
--
https://code.launchpad.net/~mterry/indicator-session/lightdm-updates/+merge/69686
Your team ayatana-commits is subscribed to branch lp:indicator-session.
=== modified file 'src/display-manager.xml'
--- src/display-manager.xml 2011-07-05 06:10:58 +0000
+++ src/display-manager.xml 2011-07-28 16:43:23 +0000
@@ -1,17 +1,20 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
- <interface name="org.freedesktop.DisplayManager">
+ <interface name="org.freedesktop.DisplayManager.Seat">
<!-- Show greeter to allow new login / switch users -->
- <method name="ShowGreeter"/>
+ <method name="SwitchToGreeter"/>
<!-- Switch to a user, starting a new display if required -->
<method name="SwitchToUser">
<arg name="username" direction="in" type="s"/>
+ <arg name="session" direction="in" type="s"/>
</method>
<!-- Switch to the guest user -->
- <method name="SwitchToGuest"/>
+ <method name="SwitchToGuest">
+ <arg name="session" direction="in" type="s"/>
+ </method>
</interface>
</node>
=== modified file 'src/users-service-dbus.c'
--- src/users-service-dbus.c 2011-07-11 10:58:39 +0000
+++ src/users-service-dbus.c 2011-07-28 16:43:23 +0000
@@ -195,15 +195,50 @@
create_display_manager_proxy (UsersServiceDbus *self)
{
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
+ DBusGProxy *dm_proxy = NULL;
+ GError *error = NULL;
+ const gchar *cookie = NULL;
+ gchar *seat = NULL;
+
+ cookie = g_getenv ("XDG_SESSION_COOKIE");
+ if (cookie == NULL || cookie[0] == 0)
+ {
+ g_warning ("Failed to get DisplayManager proxy: XDG_SESSION_COOKIE undefined.");
+ return;
+ }
+
+ dm_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
+ "org.freedesktop.DisplayManager",
+ "/org/freedesktop/DisplayManager",
+ "org.freedesktop.DisplayManager");
+
+ if (!dm_proxy)
+ {
+ g_warning ("Failed to get DisplayManager proxy.");
+ return;
+ }
+
+ /* Now request the proper seat */
+ if (!dbus_g_proxy_call (dm_proxy, "GetSeatForCookie", &error,
+ G_TYPE_STRING, cookie, G_TYPE_INVALID,
+ DBUS_TYPE_G_OBJECT_PATH, &seat, G_TYPE_INVALID))
+ {
+ g_warning ("Failed to get DisplayManager seat proxy: %s", error->message);
+ g_object_unref (dm_proxy);
+ g_error_free (error);
+ return;
+ }
+ g_object_unref (dm_proxy);
priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
"org.freedesktop.DisplayManager",
- "/org/freedesktop/DisplayManager",
- "org.freedesktop.DisplayManager");
+ seat,
+ "org.freedesktop.DisplayManager.Seat");
+ g_free (seat);
if (!priv->display_manager_proxy)
{
- g_warning ("Failed to get DisplayManager proxy.");
+ g_warning ("Failed to get DisplayManager seat proxy.");
return;
}
}
@@ -780,7 +815,7 @@
{
g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- return org_freedesktop_DisplayManager_show_greeter(priv->display_manager_proxy, NULL);
+ return org_freedesktop_DisplayManager_Seat_switch_to_greeter(priv->display_manager_proxy, NULL);
}
/* Activates the guest account if it can. */
@@ -789,7 +824,7 @@
{
g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- return org_freedesktop_DisplayManager_switch_to_guest(priv->display_manager_proxy, NULL);
+ return org_freedesktop_DisplayManager_Seat_switch_to_guest(priv->display_manager_proxy, "", NULL);
}
/* Activates a specific user */
@@ -799,7 +834,7 @@
{
g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- return org_freedesktop_DisplayManager_switch_to_user(priv->display_manager_proxy, user->user_name, NULL);
+ return org_freedesktop_DisplayManager_Seat_switch_to_user(priv->display_manager_proxy, user->user_name, "", NULL);
}
gboolean
Follow ups