diff options
Diffstat (limited to 'gtk/a11y/gtkwidgetaccessible.c')
-rw-r--r-- | gtk/a11y/gtkwidgetaccessible.c | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c index 2a32fe6bf6..437c1212b1 100644 --- a/gtk/a11y/gtkwidgetaccessible.c +++ b/gtk/a11y/gtkwidgetaccessible.c @@ -43,25 +43,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkWidgetAccessible, gtk_widget_accessible, GTK_TYPE_AC G_ADD_PRIVATE (GtkWidgetAccessible) G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)) -/* Translate GtkWidget::focus-in/out-event to AtkObject::focus-event */ -static gboolean -focus_cb (GtkWidget *widget, - GdkEvent *event) -{ - if (gdk_event_get_event_type (event) == GDK_FOCUS_CHANGE) - { - AtkObject *obj; - gboolean in; - - obj = gtk_widget_get_accessible (widget); - - gdk_event_get_focus_in (event, &in); - g_signal_emit_by_name (obj, "focus-event", in); - } - - return GDK_EVENT_PROPAGATE; -} - /* Translate GtkWidget property change notification to the notify_gtk vfunc */ static void notify_cb (GObject *obj, @@ -108,18 +89,6 @@ map_cb (GtkWidget *widget) } static void -gtk_widget_accessible_focus_event (AtkObject *obj, - gboolean focus_in) -{ - AtkObject *focus_obj; - - focus_obj = g_object_get_data (G_OBJECT (obj), "gail-focus-object"); - if (focus_obj == NULL) - focus_obj = obj; - atk_object_notify_state_change (focus_obj, ATK_STATE_FOCUSED, focus_in); -} - -static void gtk_widget_accessible_update_tooltip (GtkWidgetAccessible *accessible, GtkWidget *widget) { @@ -137,7 +106,6 @@ gtk_widget_accessible_initialize (AtkObject *obj, widget = GTK_WIDGET (data); - g_signal_connect_after (widget, "event", G_CALLBACK (focus_cb), NULL); g_signal_connect (widget, "notify", G_CALLBACK (notify_cb), NULL); g_signal_connect (widget, "size-allocate", G_CALLBACK (size_allocate_cb), NULL); g_signal_connect (widget, "map", G_CALLBACK (map_cb), NULL); @@ -466,11 +434,10 @@ gtk_widget_accessible_notify_gtk (GObject *obj, gboolean value; if (g_strcmp0 (pspec->name, "has-focus") == 0) - /* - * We use focus change events to catch - * focus changes so we ignore this. - */ - return; + { + state = ATK_STATE_FOCUSED; + value = gtk_widget_has_focus (widget); + } else if (g_strcmp0 (pspec->name, "tooltip-text") == 0) { gtk_widget_accessible_update_tooltip (GTK_WIDGET_ACCESSIBLE (atk_obj), @@ -545,7 +512,6 @@ gtk_widget_accessible_class_init (GtkWidgetAccessibleClass *klass) class->get_index_in_parent = gtk_widget_accessible_get_index_in_parent; class->initialize = gtk_widget_accessible_initialize; class->get_attributes = gtk_widget_accessible_get_attributes; - class->focus_event = gtk_widget_accessible_focus_event; } static void |