Commit dbabff08 authored by Benjamin Otte's avatar Benjamin Otte

a11y: Invoke key snooper directly

Gets around the deprecated function warnings.
parent 637e6688
......@@ -30,7 +30,6 @@
static GHashTable *listener_list = NULL;
static gint listener_idx = 1;
static GSList *key_listener_list = NULL;
static guint key_snooper_id = 0;
typedef struct _GailUtilListenerInfo GailUtilListenerInfo;
typedef struct _GailKeyEventInfo GailKeyEventInfo;
......@@ -368,10 +367,9 @@ typedef struct {
guint key;
} KeyEventListener;
static gint
gail_key_snooper (GtkWidget *the_widget,
GdkEventKey *event,
gpointer data)
gboolean
_gail_util_key_snooper (GtkWidget *the_widget,
GdkEventKey *event)
{
GSList *l;
AtkKeyEventStruct *atk_event;
......@@ -399,9 +397,6 @@ gail_util_add_key_event_listener (AtkKeySnoopFunc listener_func,
static guint key = 0;
KeyEventListener *listener;
if (key_snooper_id == 0)
key_snooper_id = gtk_key_snooper_install (gail_key_snooper, NULL);
key++;
listener = g_slice_new0 (KeyEventListener);
......@@ -431,12 +426,6 @@ gail_util_remove_key_event_listener (guint listener_key)
break;
}
}
if (key_listener_list == NULL)
{
gtk_key_snooper_remove (key_snooper_id);
key_snooper_id = 0;
}
}
static AtkObject *
......
......@@ -26,6 +26,9 @@ G_BEGIN_DECLS
void _gail_util_install (void);
gboolean _gail_util_key_snooper (GtkWidget *the_widget,
GdkEventKey *event);
G_END_DECLS
#endif /* __GAIL_UTIL_H__ */
......@@ -130,6 +130,7 @@
#include "gtkwidgetprivate.h"
#include "gtkwindowprivate.h"
#include "a11y/gailutil.h"
/* Private type definitions
*/
......@@ -2206,6 +2207,8 @@ gtk_invoke_key_snoopers (GtkWidget *grab_widget,
GSList *slist;
gint return_val = FALSE;
return_val = _gail_util_key_snooper (grab_widget, event);
slist = key_snoopers;
while (slist && !return_val)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment