Re: gdk_property_change oddity



Robert Brady <robert suse co uk> writes:

> gtk+/gdk/x11/gdkproperty-x11.c contains :
> 
> >  g_return_if_fail (window != NULL);
> >  g_return_if_fail (GDK_IS_WINDOW (window));
> 
> >  if (window)
>      [do stuff]
> >  else
>      [do other stuff]
> 
> The g_return_if_fail (window != NULL) seems to make no sense
> here.  Would it be ok to replace this checking with
> 
>    g_return_if_fail (!window || GDK_IS_WINDOW (window));
> 
> ?

Hmmm, the GDK property functions are pretty screwed up actually.  They
were was written without much understanding of XChangeProperty/
XGetWindowProperty, and then fixed up by me when I only half
understood these functions.

Since X properties are by definition, X specific, in GDK code that
accesses X properties I always use XGetWindowProperty/XChangeProperty
directly, since the behavior of these functions is precisely defined,
if rather oddball.


That being said, you are probably right that we should restore
the window == NULL => root window stuff, since it worked
that way in GTK+-1.2. Please don't use it though.

(The same fix needs to be made in gdk_property_get().)

Regards,
                                        Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]