GNOME Bugzilla – Bug 687821
[wip] Add new SessionIsActive property
Last modified: 2012-11-15 15:01:18 UTC
Merge the code from gnome-settings-daemon to monitor session active state, unfortunately down-porting it to dbus-glib in the ConsoleKit case. Even more unfortunately, we hand-roll a PropertiesChanged signal for GDBus consuemrs.
Created attachment 228331 [details] [review] [wip] Add new SessionIsActive property
Review of attachment 228331 [details] [review]: ::: gnome-session/gsm-manager.c @@ +2731,3 @@ + dbus_message_iter_close_container (&dict_iter, &v_iter); + dbus_message_iter_close_container (&subiter, &dict_iter); + dbus_message_iter_close_container (&iter, &subiter); Is the funny indentation here intentional ? @@ +2736,3 @@ + dbus_message_iter_close_container (&iter, &subiter); + + g_printerr ("SESSION: EMIT ACTIVE CHANGED %d\n", is_active); Leftover debug spew ::: gnome-session/gsm-systemd.c @@ +91,2 @@ g_clear_object (&systemd->priv->sd_proxy); + free (systemd->priv->session_id); Independent bug fix ? Should probably go in a separate commit @@ +245,3 @@ + active = active_r; + if (active != self->priv->is_active) { + g_printerr ("SESSION: NOTIFY ACTIVE %d -> %d\n", self->priv->is_active, active); Leftover debug spew ?
I was sending this patch in early form for high level feedback, will remove debug spew and such.
Created attachment 228361 [details] [review] GsmSystemd: use free() on string returned from libsystemd, not g_free() Doesn't matter now, but it may sometime in the future. Also, it's just good to stay on one's toes in C about what kinds of pointers need to be freed with which function.
Created attachment 228362 [details] [review] Add new SessionIsActive property Merge the code from gnome-settings-daemon to monitor session active state, unfortunately down-porting it to dbus-glib in the ConsoleKit case. Even more unfortunately, we hand-roll a PropertiesChanged signal for GDBus consuemrs.
Review of attachment 228361 [details] [review]: good catch
Review of attachment 228362 [details] [review]: Looks good to me
Review of attachment 228362 [details] [review]: We should get this landed
Attachment 228361 [details] pushed as c95bb13 - GsmSystemd: use free() on string returned from libsystemd, not g_free() Attachment 228362 [details] pushed as 27ded09 - Add new SessionIsActive property