Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,144
Issues
1,144
List
Boards
Labels
Service Desk
Milestones
Merge Requests
141
Merge Requests
141
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gtk
Commits
c4639142
Commit
c4639142
authored
Jan 21, 2021
by
Emmanuele Bassi
👣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ebassi/lazier-a11y' into 'master'
Lazier accessibility See merge request
!3102
parents
68df7527
95ceb497
Pipeline
#249122
passed with stages
in 48 minutes and 55 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
+35
-14
gtk/a11y/gtkatspicache.c
gtk/a11y/gtkatspicache.c
+15
-1
gtk/gtkwidget.c
gtk/gtkwidget.c
+13
-13
gtk/gtkwidgetprivate.h
gtk/gtkwidgetprivate.h
+3
-0
gtk/gtkwindow.c
gtk/gtkwindow.c
+4
-0
No files found.
gtk/a11y/gtkatspicache.c
View file @
c4639142
...
...
@@ -58,6 +58,9 @@ struct _GtkAtSpiCache
/* HashTable<GtkAtSpiContext, str> */
GHashTable
*
contexts_to_path
;
/* Re-entrancy guard */
gboolean
in_get_items
;
};
enum
...
...
@@ -250,10 +253,17 @@ handle_cache_method (GDBusConnection *connection,
{
GVariantBuilder
builder
=
G_VARIANT_BUILDER_INIT
(
G_VARIANT_TYPE
(
"("
GET_ITEMS_SIGNATURE
")"
));
/* Prevent the emission os signals while collecting accessible
* objects as the result of walking the accessible tree
*/
self
->
in_get_items
=
TRUE
;
g_variant_builder_open
(
&
builder
,
G_VARIANT_TYPE
(
GET_ITEMS_SIGNATURE
));
collect_cached_objects
(
self
,
&
builder
);
g_variant_builder_close
(
&
builder
);
self
->
in_get_items
=
FALSE
;
g_dbus_method_invocation_return_value
(
invocation
,
g_variant_builder_end
(
&
builder
));
}
}
...
...
@@ -371,7 +381,11 @@ gtk_at_spi_cache_add_context (GtkAtSpiCache *self,
GTK_NOTE
(
A11Y
,
g_message
(
"Adding context '%s' to cache"
,
path_key
));
emit_add_accessible
(
self
,
context
);
/* GetItems is safe from re-entrancy, but we still don't want to
* emit an unnecessary signal while we're collecting ATContexts
*/
if
(
!
self
->
in_get_items
)
emit_add_accessible
(
self
,
context
);
}
void
...
...
gtk/gtkwidget.c
View file @
c4639142
...
...
@@ -2374,7 +2374,7 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
priv
->
at_context
=
gtk_accessible_get_at_context
(
GTK_ACCESSIBLE
(
widget
));
}
static
void
void
gtk_widget_realize_at_context
(
GtkWidget
*
self
)
{
GtkWidgetPrivate
*
priv
=
gtk_widget_get_instance_private
(
self
);
...
...
@@ -2383,10 +2383,6 @@ gtk_widget_realize_at_context (GtkWidget *self)
if
(
priv
->
at_context
==
NULL
||
gtk_at_context_is_realized
(
priv
->
at_context
))
return
;
/* Realize the root ATContext first */
if
(
!
GTK_IS_ROOT
(
self
))
gtk_widget_realize_at_context
(
GTK_WIDGET
(
priv
->
root
));
/* Reset the accessible role to its current value */
if
(
role
==
GTK_ACCESSIBLE_ROLE_WIDGET
)
{
...
...
@@ -2400,6 +2396,18 @@ gtk_widget_realize_at_context (GtkWidget *self)
gtk_at_context_realize
(
priv
->
at_context
);
}
void
gtk_widget_unrealize_at_context
(
GtkWidget
*
widget
)
{
GtkWidgetPrivate
*
priv
=
gtk_widget_get_instance_private
(
widget
);
if
(
priv
->
at_context
!=
NULL
)
{
gtk_at_context_set_display
(
priv
->
at_context
,
gdk_display_get_default
());
gtk_at_context_unrealize
(
priv
->
at_context
);
}
}
void
gtk_widget_root
(
GtkWidget
*
widget
)
{
...
...
@@ -2428,8 +2436,6 @@ gtk_widget_root (GtkWidget *widget)
if
(
priv
->
layout_manager
)
gtk_layout_manager_set_root
(
priv
->
layout_manager
,
priv
->
root
);
gtk_widget_realize_at_context
(
widget
);
GTK_WIDGET_GET_CLASS
(
widget
)
->
root
(
widget
);
if
(
!
GTK_IS_ROOT
(
widget
))
...
...
@@ -2454,12 +2460,6 @@ gtk_widget_unroot (GtkWidget *widget)
GTK_WIDGET_GET_CLASS
(
widget
)
->
unroot
(
widget
);
if
(
priv
->
at_context
!=
NULL
)
{
gtk_at_context_set_display
(
priv
->
at_context
,
gdk_display_get_default
());
gtk_at_context_unrealize
(
priv
->
at_context
);
}
if
(
priv
->
context
)
gtk_style_context_set_display
(
priv
->
context
,
gdk_display_get_default
());
...
...
gtk/gtkwidgetprivate.h
View file @
c4639142
...
...
@@ -373,6 +373,9 @@ gboolean gtk_widget_focus_self (GtkWidget *widget,
void
gtk_widget_update_orientation
(
GtkWidget
*
widget
,
GtkOrientation
orientation
);
void
gtk_widget_realize_at_context
(
GtkWidget
*
widget
);
void
gtk_widget_unrealize_at_context
(
GtkWidget
*
widget
);
/* inline getters */
static
inline
GtkWidget
*
...
...
gtk/gtkwindow.c
View file @
c4639142
...
...
@@ -3806,6 +3806,8 @@ gtk_window_map (GtkWidget *widget)
if
(
priv
->
application
)
gtk_application_handle_window_map
(
priv
->
application
,
window
);
gtk_widget_realize_at_context
(
widget
);
}
static
void
...
...
@@ -3818,6 +3820,8 @@ gtk_window_unmap (GtkWidget *widget)
GTK_WIDGET_CLASS
(
gtk_window_parent_class
)
->
unmap
(
widget
);
gdk_surface_hide
(
priv
->
surface
);
gtk_widget_unrealize_at_context
(
widget
);
if
(
priv
->
title_box
!=
NULL
)
gtk_widget_unmap
(
priv
->
title_box
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment