Merge lp:~robert-ancell/indicator-session/use-xdg-seat-path into lp:indicator-session/0.1

Proposed by Robert Ancell
Status: Merged
Merged at revision: 218
Proposed branch: lp:~robert-ancell/indicator-session/use-xdg-seat-path
Merge into: lp:indicator-session/0.1
Diff against target: 55 lines (+2/-34)
1 file modified
src/users-service-dbus.c (+2/-34)
To merge this branch: bzr merge lp:~robert-ancell/indicator-session/use-xdg-seat-path
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+76331@code.launchpad.net

Description of the change

Don't use depcrecated org.freedesktop.DisplayManager.GetSeatForCookie, use XDG_SEAT_PATH instead. GetSeatForCookie/GetSessionForCookie has been removed in LightDM 0.9.8.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I've put these methods back in for 0.9.8 so I can upgrade lightdm without this patch, but please apply it as I will remove these at some point.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/users-service-dbus.c'
--- src/users-service-dbus.c 2011-09-08 09:23:55 +0000
+++ src/users-service-dbus.c 2011-09-21 05:50:31 +0000
@@ -203,40 +203,10 @@
203create_display_manager_proxy (UsersServiceDbus *self)203create_display_manager_proxy (UsersServiceDbus *self)
204{204{
205 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);205 UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
206 DBusGProxy *dm_proxy = NULL;
207 GError *error = NULL;206 GError *error = NULL;
208 const gchar *cookie = NULL;207 const gchar *seat = NULL;
209 gchar *seat = NULL;
210 208
211 cookie = g_getenv ("XDG_SESSION_COOKIE");209 seat = g_getenv ("XDG_SEAT_PATH");
212 if (cookie == NULL || cookie[0] == 0)
213 {
214 g_warning ("Failed to get DisplayManager proxy: XDG_SESSION_COOKIE undefined.");
215 return;
216 }
217
218 dm_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
219 "org.freedesktop.DisplayManager",
220 "/org/freedesktop/DisplayManager",
221 "org.freedesktop.DisplayManager");
222
223 if (!dm_proxy)
224 {
225 g_warning ("Failed to get DisplayManager proxy.");
226 return;
227 }
228
229 /* Now request the proper seat */
230 if (!dbus_g_proxy_call (dm_proxy, "GetSeatForCookie", &error,
231 G_TYPE_STRING, cookie, G_TYPE_INVALID,
232 DBUS_TYPE_G_OBJECT_PATH, &seat, G_TYPE_INVALID))
233 {
234 g_warning ("Failed to get DisplayManager seat proxy: %s", error->message);
235 g_object_unref (dm_proxy);
236 g_error_free (error);
237 return;
238 }
239 g_object_unref (dm_proxy);
240 g_debug ("CREATING DM PROXIES WITH %s", seat);210 g_debug ("CREATING DM PROXIES WITH %s", seat);
241 priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,211 priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
242 "org.freedesktop.DisplayManager",212 "org.freedesktop.DisplayManager",
@@ -249,8 +219,6 @@
249 "org.freedesktop.DBus.Properties");219 "org.freedesktop.DBus.Properties");
250220
251221
252 g_free (seat);
253
254 if (!priv->display_manager_proxy)222 if (!priv->display_manager_proxy)
255 {223 {
256 g_warning ("Failed to get DisplayManager seat proxy.");224 g_warning ("Failed to get DisplayManager seat proxy.");

Subscribers

People subscribed via source and target branches