[gtk+] Explicitly set the a11y role of tooltip windows



commit 50c848a992282f411511d0fef4642026dec6bef6
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 18 17:25:05 2015 -0500

    Explicitly set the a11y role of tooltip windows
    
    This seems better than trying to identify the 'tooltipness'
    of the window on the other side.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744683

 gtk/gtktooltip.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index ea76210..30c7333 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -35,6 +35,7 @@
 #include "gtksizerequest.h"
 #include "gtkstylecontext.h"
 #include "gtkwindowprivate.h"
+#include "gtkaccessible.h"
 
 
 #ifdef GDK_WINDOWING_WAYLAND
@@ -170,6 +171,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
   GtkWidget *box;
   GtkWidget *image;
   GtkWidget *label;
+  AtkObject *atk_obj;
 
   tooltip->timeout_id = 0;
   tooltip->browse_mode_timeout_id = 0;
@@ -195,6 +197,10 @@ gtk_tooltip_init (GtkTooltip *tooltip)
   context = gtk_widget_get_style_context (window);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP);
 
+  atk_obj = gtk_widget_get_accessible (window);
+  if (GTK_IS_ACCESSIBLE (atk_obj))
+    atk_object_set_role (atk_obj, ATK_ROLE_TOOL_TIP);
+
   /* FIXME: don't hardcode the padding */
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_widget_set_margin_start (box, 6);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]