gdk_window_{add|remove}_filter() trouble



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 */
  
  /* 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.

---
ciaoTJ



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