diff --git a/ChangeLog b/ChangeLog index f547b164d..73722c341 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-11 Mike Kestner + + * gdk/Window.custom : add AddFilterForAll and RemoveFilterForAll + methods to handle the window==null native case. + [Fixes #71065] + 2005-01-11 Mike Kestner * glib/Argv.cs : add automatic progname handling. diff --git a/doc/en/Gdk/Window.xml b/doc/en/Gdk/Window.xml index af9213322..f14c5e96c 100644 --- a/doc/en/Gdk/Window.xml +++ b/doc/en/Gdk/Window.xml @@ -1946,5 +1946,35 @@ The color must be allocated; Area includes window manager titlebar/borders if any. The frame position is given in root window coordinates. To get the position of the window itself (rather than the frame) in root window coordinates, use . + + + Method + + System.Void + + + + + + Adds an event filtering function for all Windows. + a + It is possible to do significant damage to Gdk's built in event processing using this capability if used improperly. + + + + + Method + + System.Void + + + + + + Removes an event filtering function for all Windows. + a + + + - \ No newline at end of file + diff --git a/gdk/Window.custom b/gdk/Window.custom index 2a93ec5ab..5d77fc632 100644 --- a/gdk/Window.custom +++ b/gdk/Window.custom @@ -104,6 +104,31 @@ } } + static Hashtable filter_all_hash; + static Hashtable FilterAllHash { + get { + if (filter_all_hash == null) + filter_all_hash = new Hashtable (); + return filter_all_hash; + } + } + + public static void AddFilterForAll (FilterFunc func) + { + GdkSharp.FilterFuncWrapper wrapper = new GdkSharp.FilterFuncWrapper (func, null); + FilterAllHash [func] = wrapper; + gdk_window_add_filter (IntPtr.Zero, wrapper.NativeDelegate, IntPtr.Zero); + } + + public static void RemoveFilterForAll (FilterFunc func) + { + GdkSharp.FilterFuncWrapper wrapper = FilterAllHash [func] as GdkSharp.FilterFuncWrapper; + if (wrapper == null) + return; + FilterAllHash.Remove (func); + gdk_window_remove_filter (IntPtr.Zero, wrapper.NativeDelegate, IntPtr.Zero); + } + #if MANLY_ENOUGH_TO_INCLUDE public Cairo.Graphics CairoGraphics (out int offset_x, out int offset_y) {