[gtk+] a11y: Set up popup-for relation between entry and completion
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Set up popup-for relation between entry and completion
- Date: Sun, 3 Feb 2013 21:32:15 +0000 (UTC)
commit 1e85e0f017d7dcf283255033d526f840d4c325eb
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 3 16:32:21 2013 -0500
a11y: Set up popup-for relation between entry and completion
This may address
https://bugzilla.gnome.org/show_bug.cgi?id=658148
gtk/gtkentrycompletion.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 2f4bd28..e4968df 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -2611,6 +2611,35 @@ connect_completion_signals (GtkEntryCompletion *completion)
}
}
+static void
+set_accessible_relation (GtkWidget *window,
+ GtkWidget *entry)
+{
+ AtkObject *window_accessible;
+ AtkObject *entry_accessible;
+
+ window_accessible = gtk_widget_get_accessible (window);
+ entry_accessible = gtk_widget_get_accessible (entry);
+
+ atk_object_add_relationship (window_accessible,
+ ATK_RELATION_POPUP_FOR,
+ entry_accessible);
+}
+
+static void
+unset_accessible_relation (GtkWidget *window,
+ GtkWidget *entry)
+{
+ AtkObject *window_accessible;
+ AtkObject *entry_accessible;
+
+ window_accessible = gtk_widget_get_accessible (window);
+ entry_accessible = gtk_widget_get_accessible (entry);
+
+ atk_object_remove_relationship (window_accessible,
+ ATK_RELATION_POPUP_FOR,
+ entry_accessible);
+}
static void
disconnect_completion_signals (GtkEntryCompletion *completion)
@@ -2660,6 +2689,9 @@ _gtk_entry_completion_disconnect (GtkEntryCompletion *completion)
disconnect_completion_signals (completion);
+ unset_accessible_relation (completion->priv->popup_window,
+ completion->priv->entry);
+
completion->priv->entry = NULL;
}
@@ -2668,5 +2700,9 @@ _gtk_entry_completion_connect (GtkEntryCompletion *completion,
GtkEntry *entry)
{
completion->priv->entry = GTK_WIDGET (entry);
+
+ set_accessible_relation (completion->priv->popup_window,
+ completion->priv->entry);
+
connect_completion_signals (completion);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]