GNOME Bugzilla – Bug 604787
property-notify-event is not delivered to a non-toplevel widget
Last modified: 2009-12-18 23:46:18 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.
Alex, does gdk_property_change need to call gdk_ensure_native ?
yeah, seems like a good idea.
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.
Using x properties on non-toplevel windows for inter-process communication is really exotic.
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.