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 604787 - property-notify-event is not delivered to a non-toplevel widget
property-notify-event is not delivered to a non-toplevel widget
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
csw
Depends on:
Blocks:
 
 
Reported: 2009-12-17 00:49 UTC by Kevin Ryde
Modified: 2009-12-18 23:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample failing program (1.50 KB, text/x-csrc)
2009-12-17 00:49 UTC, Kevin Ryde
Details

Description Kevin Ryde 2009-12-17 00:49:38 UTC
Created attachment 149890 [details]
sample failing program

In debian i386 packaged gtk 2.18.3 and 2.18.4 under X11, a non-toplevel widget (with GDK_PROPERTY_CHANGE_MASK selected of course) doesn't receive a property-notify-event signal.

I expected the the attached foo.c program to print

    property-notify-event received

but it doesn't.  I believe this is a regression, that it worked fine in 2.16 or thereabouts (where I'd been using it from perl-gtk).

While tinkering, I noticed that if there's a gdk_x11_drawable_get_xid() call, as commented out in the program, then the signal event is delivered correctly.  Fairly surprising that a mere get of a number field made it spring into life.

It also works if the target widget is the toplevel GtkWindow instead of the child GtkDrawingArea.

Running the program under xmon shows a PropertyNotify is sent by the server to the GtkDrawingArea window as expected, but it then doesn't seem to raise the property-notify-event signal.
Comment 1 Matthias Clasen 2009-12-17 05:09:05 UTC
Alex, 

does gdk_property_change need to call gdk_ensure_native ?
Comment 2 Alexander Larsson 2009-12-17 19:23:14 UTC
yeah, seems like a good idea.
Comment 3 Kevin Ryde 2009-12-17 20:06:32 UTC
As to gdk_property_change, I would hope a property-notify-event can be delivered if something external makes a property change too, not just a gdk_property_change from within the same process.  External changes are probably more common in fact, as an inter-process communication.

Oh, and in case it make a difference my version numbers were off by one, it's 2.18.4 and 2.18.5 I've been using.
Comment 4 Matthias Clasen 2009-12-17 20:07:41 UTC
Using x properties on non-toplevel windows for inter-process communication is really exotic.
Comment 5 Kevin Ryde 2009-12-17 20:55:38 UTC
Well, put it this way, I believe there's no reason to enquire why an event has arrived on a widget's window, just deliver it to the signal handlers.