After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687821 - [wip] Add new SessionIsActive property
[wip] Add new SessionIsActive property
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks: 686650
 
 
Reported: 2012-11-07 02:04 UTC by Colin Walters
Modified: 2012-11-15 15:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[wip] Add new SessionIsActive property (20.62 KB, patch)
2012-11-07 02:04 UTC, Colin Walters
needs-work Details | Review
GsmSystemd: use free() on string returned from libsystemd, not g_free() (1.30 KB, patch)
2012-11-07 12:56 UTC, Colin Walters
committed Details | Review
Add new SessionIsActive property (20.44 KB, patch)
2012-11-07 12:56 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2012-11-07 02:04:50 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.
Comment 1 Colin Walters 2012-11-07 02:04:52 UTC
Created attachment 228331 [details] [review]
[wip] Add new SessionIsActive property
Comment 2 Matthias Clasen 2012-11-07 11:34:24 UTC
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 ?
Comment 3 Colin Walters 2012-11-07 11:49:41 UTC
I was sending this patch in early form for high level feedback, will remove debug spew and such.
Comment 4 Colin Walters 2012-11-07 12:56:14 UTC
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.
Comment 5 Colin Walters 2012-11-07 12:56:21 UTC
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.
Comment 6 Matthias Clasen 2012-11-07 23:55:06 UTC
Review of attachment 228361 [details] [review]:

good catch
Comment 7 Matthias Clasen 2012-11-08 00:05:08 UTC
Review of attachment 228362 [details] [review]:

Looks good to me
Comment 8 Matthias Clasen 2012-11-10 23:18:38 UTC
Review of attachment 228362 [details] [review]:

We should get this landed
Comment 9 Bastien Nocera 2012-11-12 08:26:09 UTC
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