Commit 50c848a9 authored by Matthias Clasen's avatar Matthias Clasen

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
parent 7624418d
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "gtksizerequest.h" #include "gtksizerequest.h"
#include "gtkstylecontext.h" #include "gtkstylecontext.h"
#include "gtkwindowprivate.h" #include "gtkwindowprivate.h"
#include "gtkaccessible.h"
#ifdef GDK_WINDOWING_WAYLAND #ifdef GDK_WINDOWING_WAYLAND
...@@ -170,6 +171,7 @@ gtk_tooltip_init (GtkTooltip *tooltip) ...@@ -170,6 +171,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
GtkWidget *box; GtkWidget *box;
GtkWidget *image; GtkWidget *image;
GtkWidget *label; GtkWidget *label;
AtkObject *atk_obj;
tooltip->timeout_id = 0; tooltip->timeout_id = 0;
tooltip->browse_mode_timeout_id = 0; tooltip->browse_mode_timeout_id = 0;
...@@ -195,6 +197,10 @@ gtk_tooltip_init (GtkTooltip *tooltip) ...@@ -195,6 +197,10 @@ gtk_tooltip_init (GtkTooltip *tooltip)
context = gtk_widget_get_style_context (window); context = gtk_widget_get_style_context (window);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP); 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 */ /* FIXME: don't hardcode the padding */
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_margin_start (box, 6); gtk_widget_set_margin_start (box, 6);
......
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