Re: gdk_window_{add|remove}_filter() trouble

Tim Janik <> writes:

> hey owen,
> gdk_window_add_filter() silently ignores double adding of callbacks,
> and gdk_window_remove_filter() silently ignores failing callback removals.
> this is inconsistent with all other callback interfaces we provide,
> and it also breaks with the good habit of reporting errors.
> for example:
>   /* window has 0 filters */
>   gdk_window_add_filter (window, g_print, "foo\n");
>   /* window has 1 filter */
>   gdk_window_add_filter (window, g_print, "foo\n");
>   /* window has 1 filter, filter adding was ignored */
>   gdk_window_remove_filter (window, g_print, "foo\n");
>   /* window has 0 filter */
[ Of course, pointer equality of constant strings is NOT
  guaranteed, even within the same object file. But I
  assume you know ]
>   /* here, no further notification occours */
>   gdk_window_remove_filter (window, g_print, "foo\n");
>   /* window has 0 filter, no warning was produced */
> i intend to fix that in the following days with the obvious
> behaviour of a) featuring the same filter more than once and
> b) honouring failing removal with a g_warning().
> this will go into both trees, i.e. HEAD and 1.2, as the current
> behaviour is simply buggy. add/remove filter is a paired interface
> and has to behave as such.

I don't think these changes can go into the 1.2 tree - they can break
working code only for consistency with the rest of GTK+. Since the
functions are documented only by their implementation, we can't go
changing them in the stable branch "because we really meant it to be
the other way".

For the 1.3 tree, while you are dealing with this, you might want
to look at my comment about the window==NULL case in the sources.


(This begs the question of whether we are going to do any more 1.2
releases - I think if we need to make more releases we should find
somebody else to deal with making them - I know it isn't productive
for me to backport every fix I make in the 1.3.x tree to 1.2 at this

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