From fc37e2749cfa7c11e72dd9f253ab5c8aa9b1af2c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 5 Jan 2012 16:50:49 +0100 Subject: [PATCH] API: Deprecate key snooping You really shouldn't be doing this. If you have to, you can use gdk_window_add_filter() or listen to raw events on XI2. --- gtk/gtkmain.c | 6 ++++++ gtk/gtkmain.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 67d843e433..a0bcf0f3ea 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -2142,6 +2142,9 @@ gtk_device_grab_remove (GtkWidget *widget, * * Returns: a unique id for this key snooper for use with * gtk_key_snooper_remove(). + * + * Deprecated: 3.4: Key snooping should not be done. Events should + * be handled by widgets. */ guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, @@ -2166,6 +2169,9 @@ gtk_key_snooper_install (GtkKeySnoopFunc snooper, * @snooper_handler_id: Identifies the key snooper to remove * * Removes the key snooper function with the given id. + * + * Deprecated: 3.4: Key snooping should not be done. Events should + * be handled by widgets. */ void gtk_key_snooper_remove (guint snooper_id) diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h index 99ce6d45ab..f6381383fa 100644 --- a/gtk/gtkmain.h +++ b/gtk/gtkmain.h @@ -152,8 +152,10 @@ void gtk_device_grab_add (GtkWidget *widget, void gtk_device_grab_remove (GtkWidget *widget, GdkDevice *device); +G_GNUC_DEPRECATED guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, gpointer func_data); +G_GNUC_DEPRECATED void gtk_key_snooper_remove (guint snooper_handler_id); GdkEvent * gtk_get_current_event (void); -- 2.22.2