Merge lp:~mterry/indicator-session/lightdm-updates into lp:indicator-session/0.1

Proposed by Michael Terry
Status: Merged
Merged at revision: 169
Proposed branch: lp:~mterry/indicator-session/lightdm-updates
Merge into: lp:indicator-session/0.1
Diff against target: 112 lines (+47/-9)
2 files modified
src/display-manager.xml (+6/-3)
src/users-service-dbus.c (+41/-6)
To merge this branch: bzr merge lp:~mterry/indicator-session/lightdm-updates
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+69686@code.launchpad.net

Description of the change

LightDM's exposed org.freedesktop.DisplayManager interface seems to have changed. Here's the updates needed to make switching work.

To post a comment you must log in.
Revision history for this message
Conor Curran (cjcurran) wrote :

looks good, thanks Michael

Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
1<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">1<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
2<node>2<node>
3 <interface name="org.freedesktop.DisplayManager">3 <interface name="org.freedesktop.DisplayManager.Seat">
44
5 <!-- Show greeter to allow new login / switch users -->5 <!-- Show greeter to allow new login / switch users -->
6 <method name="ShowGreeter"/>6 <method name="SwitchToGreeter"/>
77
8 <!-- Switch to a user, starting a new display if required -->8 <!-- Switch to a user, starting a new display if required -->
9 <method name="SwitchToUser">9 <method name="SwitchToUser">
10 <arg name="username" direction="in" type="s"/>10 <arg name="username" direction="in" type="s"/>
11 <arg name="session" direction="in" type="s"/>
11 </method>12 </method>
1213
13 <!-- Switch to the guest user -->14 <!-- Switch to the guest user -->
14 <method name="SwitchToGuest"/>15 <method name="SwitchToGuest">
16 <arg name="session" direction="in" type="s"/>
17 </method>
1518
16 </interface>19 </interface>
17</node>20</node>
1821
=== 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 @@
195create_display_manager_proxy (UsersServiceDbus *self)195create_display_manager_proxy (UsersServiceDbus *self)
196{196{
197 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);197 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
198 DBusGProxy *dm_proxy = NULL;
199 GError *error = NULL;
200 const gchar *cookie = NULL;
201 gchar *seat = NULL;
202
203 cookie = g_getenv ("XDG_SESSION_COOKIE");
204 if (cookie == NULL || cookie[0] == 0)
205 {
206 g_warning ("Failed to get DisplayManager proxy: XDG_SESSION_COOKIE undefined.");
207 return;
208 }
209
210 dm_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
211 "org.freedesktop.DisplayManager",
212 "/org/freedesktop/DisplayManager",
213 "org.freedesktop.DisplayManager");
214
215 if (!dm_proxy)
216 {
217 g_warning ("Failed to get DisplayManager proxy.");
218 return;
219 }
220
221 /* Now request the proper seat */
222 if (!dbus_g_proxy_call (dm_proxy, "GetSeatForCookie", &error,
223 G_TYPE_STRING, cookie, G_TYPE_INVALID,
224 DBUS_TYPE_G_OBJECT_PATH, &seat, G_TYPE_INVALID))
225 {
226 g_warning ("Failed to get DisplayManager seat proxy: %s", error->message);
227 g_object_unref (dm_proxy);
228 g_error_free (error);
229 return;
230 }
231 g_object_unref (dm_proxy);
198232
199 priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,233 priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
200 "org.freedesktop.DisplayManager",234 "org.freedesktop.DisplayManager",
201 "/org/freedesktop/DisplayManager",235 seat,
202 "org.freedesktop.DisplayManager");236 "org.freedesktop.DisplayManager.Seat");
237 g_free (seat);
203238
204 if (!priv->display_manager_proxy)239 if (!priv->display_manager_proxy)
205 {240 {
206 g_warning ("Failed to get DisplayManager proxy.");241 g_warning ("Failed to get DisplayManager seat proxy.");
207 return;242 return;
208 }243 }
209}244}
@@ -780,7 +815,7 @@
780{815{
781 g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);816 g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
782 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);817 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
783 return org_freedesktop_DisplayManager_show_greeter(priv->display_manager_proxy, NULL);818 return org_freedesktop_DisplayManager_Seat_switch_to_greeter(priv->display_manager_proxy, NULL);
784}819}
785820
786/* Activates the guest account if it can. */821/* Activates the guest account if it can. */
@@ -789,7 +824,7 @@
789{824{
790 g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);825 g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
791 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);826 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
792 return org_freedesktop_DisplayManager_switch_to_guest(priv->display_manager_proxy, NULL);827 return org_freedesktop_DisplayManager_Seat_switch_to_guest(priv->display_manager_proxy, "", NULL);
793}828}
794829
795/* Activates a specific user */830/* Activates a specific user */
@@ -799,7 +834,7 @@
799{834{
800 g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);835 g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
801 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);836 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
802 return org_freedesktop_DisplayManager_switch_to_user(priv->display_manager_proxy, user->user_name, NULL);837 return org_freedesktop_DisplayManager_Seat_switch_to_user(priv->display_manager_proxy, user->user_name, "", NULL);
803}838}
804839
805gboolean840gboolean

Subscribers

People subscribed via source and target branches