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 676937 - Document notify signal deduplication with freeze/thaw
Document notify signal deduplication with freeze/thaw
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-05-27 21:40 UTC by Philip Withnall
Modified: 2012-05-28 14:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gobject: Document notify signal deduplication with freeze/thaw (1.88 KB, patch)
2012-05-27 21:42 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2012-05-27 21:40:01 UTC
Patch coming to document the (useful) behaviour of GObject where duplicate “notify” signals emitted by an object while notifies are frozen will be deduplicated.
Comment 1 Philip Withnall 2012-05-27 21:42:30 UTC
Created attachment 215105 [details] [review]
gobject: Document notify signal deduplication with freeze/thaw

Here we go.
Comment 2 Emmanuele Bassi (:ebassi) 2012-05-28 04:44:41 UTC
Review of attachment 215105 [details] [review]:

looks good; personally, I'd prefer to use "notification" as the result of calling g_object_notify(), and use GObject::notify only when referring to the actual signal emission.

::: gobject/gobject.c
@@ +1071,3 @@
  * non-zero, the emission of "notify" signals on @object is
  * stopped. The signals are queued until the freeze count is decreased
+ * to zero. Duplicate signals are squashed so that at most one signal is emitted

"one #GObject::notify signal is emitted"

@@ +1245,3 @@
+ * and when it reaches zero, queued "notify" signals are emitted.
+ *
+ * Duplicate "notify" signals for each property are squashed so that at most one

"Duplicate notifications for each property"
Comment 3 Philip Withnall 2012-05-28 14:48:11 UTC
Comment on attachment 215105 [details] [review]
gobject: Document notify signal deduplication with freeze/thaw

Committed with those changes.

commit f642209ef4c7f13f5ff03ca3c315cd237f8f26bb
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun May 27 22:40:44 2012 +0100

    gobject: Document notify signal deduplication with freeze/thaw
    
    Expand the documentation for g_object_[freeze|thaw]_notify() to explain that
    it deduplicates “notify” signals emitted by frozen objects, so that at most
    one signal is emitted per property.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676937

 gobject/gobject.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)