accessibility: Set various accessible names
For actors that are created by libmutter itself. Although, not sure if such names should be translatable? Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
This commit is contained in:
parent
6874e98e5d
commit
ec028553d3
11 changed files with 29 additions and 4 deletions
|
@ -266,7 +266,10 @@ clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
|||
ClutterActor *
|
||||
clutter_scroll_actor_new (void)
|
||||
{
|
||||
return g_object_new (CLUTTER_TYPE_SCROLL_ACTOR, NULL);
|
||||
return g_object_new (CLUTTER_TYPE_SCROLL_ACTOR,
|
||||
"accessible-name", "Scroll actor",
|
||||
"accessible-role", ATK_ROLE_SCROLL_PANE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -337,6 +337,7 @@ meta_stage_new (MetaBackend *backend)
|
|||
|
||||
stage = g_object_new (META_TYPE_STAGE,
|
||||
"context", meta_backend_get_clutter_context (backend),
|
||||
"accessible-name", "Main stage",
|
||||
NULL);
|
||||
stage->backend = backend;
|
||||
|
||||
|
|
|
@ -334,8 +334,11 @@ meta_compositor_manage (MetaCompositor *compositor,
|
|||
compositor);
|
||||
|
||||
priv->window_group = meta_window_group_new (display);
|
||||
clutter_actor_set_accessible_name (priv->window_group, "Window group");
|
||||
priv->top_window_group = meta_window_group_new (display);
|
||||
clutter_actor_set_accessible_name (priv->top_window_group, "Top window group");
|
||||
priv->feedback_group = meta_window_group_new (display);
|
||||
clutter_actor_set_accessible_name (priv->feedback_group, "Feedback group");
|
||||
|
||||
clutter_actor_add_child (stage, priv->window_group);
|
||||
clutter_actor_add_child (stage, priv->top_window_group);
|
||||
|
@ -379,18 +382,21 @@ meta_compositor_add_window (MetaCompositor *compositor,
|
|||
MetaWindowActor *window_actor;
|
||||
ClutterActor *window_group;
|
||||
GType window_actor_type = G_TYPE_INVALID;
|
||||
const char *accessible_name = NULL;
|
||||
|
||||
switch (window->client_type)
|
||||
{
|
||||
#ifdef HAVE_X11_CLIENT
|
||||
case META_WINDOW_CLIENT_TYPE_X11:
|
||||
window_actor_type = META_TYPE_WINDOW_ACTOR_X11;
|
||||
accessible_name = "X11 window";
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
case META_WINDOW_CLIENT_TYPE_WAYLAND:
|
||||
window_actor_type = META_TYPE_WINDOW_ACTOR_WAYLAND;
|
||||
accessible_name = "Wayland window";
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -400,6 +406,7 @@ meta_compositor_add_window (MetaCompositor *compositor,
|
|||
|
||||
window_actor = g_object_new (window_actor_type,
|
||||
"meta-window", window,
|
||||
"accessible-name", accessible_name,
|
||||
"show-on-set-parent", FALSE,
|
||||
NULL);
|
||||
|
||||
|
@ -1331,6 +1338,7 @@ meta_compositor_flash_display (MetaCompositor *compositor,
|
|||
clutter_actor_get_size (stage, &width, &height);
|
||||
|
||||
flash = clutter_actor_new ();
|
||||
clutter_actor_set_accessible_name (flash, "Flash actor");
|
||||
clutter_actor_set_background_color (flash, &COGL_COLOR_INIT (0, 0, 0, 255));
|
||||
clutter_actor_set_size (flash, width, height);
|
||||
clutter_actor_set_opacity (flash, 0);
|
||||
|
@ -1370,6 +1378,7 @@ meta_compositor_flash_window (MetaCompositor *compositor,
|
|||
ClutterTransition *transition;
|
||||
|
||||
flash = clutter_actor_new ();
|
||||
clutter_actor_set_accessible_name (flash, "Flash actor");
|
||||
clutter_actor_set_background_color (flash, &COGL_COLOR_INIT (0, 0, 0, 255));
|
||||
clutter_actor_set_size (flash, window->rect.width, window->rect.height);
|
||||
clutter_actor_set_position (flash,
|
||||
|
|
|
@ -157,6 +157,7 @@ meta_background_actor_new (MetaDisplay *display,
|
|||
self = g_object_new (META_TYPE_BACKGROUND_ACTOR,
|
||||
"meta-display", display,
|
||||
"monitor", monitor,
|
||||
"accessible-name", "Background actor",
|
||||
NULL);
|
||||
|
||||
return CLUTTER_ACTOR (self);
|
||||
|
|
|
@ -60,7 +60,9 @@ meta_background_group_new (void)
|
|||
{
|
||||
MetaBackgroundGroup *background_group;
|
||||
|
||||
background_group = g_object_new (META_TYPE_BACKGROUND_GROUP, NULL);
|
||||
background_group = g_object_new (META_TYPE_BACKGROUND_GROUP,
|
||||
"accessible-name", "Background group",
|
||||
NULL);
|
||||
|
||||
return CLUTTER_ACTOR (background_group);
|
||||
}
|
||||
|
|
|
@ -161,6 +161,7 @@ meta_dnd_actor_new (MetaCompositor *compositor,
|
|||
"drag-origin", drag_origin,
|
||||
"drag-start-x", drag_start_x,
|
||||
"drag-start-y", drag_start_y,
|
||||
"accessible-name", "Drag and drop actor",
|
||||
NULL);
|
||||
|
||||
return CLUTTER_ACTOR (self);
|
||||
|
|
|
@ -316,7 +316,9 @@ meta_surface_actor_wayland_init (MetaSurfaceActorWayland *self)
|
|||
MetaSurfaceActor *
|
||||
meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
|
||||
{
|
||||
MetaSurfaceActorWayland *self = g_object_new (META_TYPE_SURFACE_ACTOR_WAYLAND, NULL);
|
||||
MetaSurfaceActorWayland *self = g_object_new (META_TYPE_SURFACE_ACTOR_WAYLAND,
|
||||
"accessible-name", "Wayland surface",
|
||||
NULL);
|
||||
|
||||
g_assert (meta_is_wayland_compositor ());
|
||||
|
||||
|
|
|
@ -419,6 +419,7 @@ meta_surface_actor_x11_new (MetaWindow *window)
|
|||
sync_unredirected (self);
|
||||
|
||||
clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
|
||||
clutter_actor_set_accessible_name (CLUTTER_ACTOR (self), "X11 surface");
|
||||
return META_SURFACE_ACTOR (self);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ surface_container_new (MetaWindowActor *window_actor)
|
|||
MetaSurfaceContainerActorWayland *surface_container;
|
||||
|
||||
surface_container = g_object_new (META_TYPE_SURFACE_CONTAINER_ACTOR_WAYLAND,
|
||||
"accessible-name", "Wayland surface container",
|
||||
NULL);
|
||||
surface_container->window_actor = window_actor;
|
||||
|
||||
|
|
|
@ -1845,6 +1845,8 @@ meta_window_drag_begin (MetaWindowDrag *window_drag,
|
|||
window_drag->handler = clutter_actor_new ();
|
||||
clutter_actor_set_name (window_drag->handler,
|
||||
"Window drag helper");
|
||||
clutter_actor_set_accessible_name (window_drag->handler,
|
||||
"Window drag helper");
|
||||
g_signal_connect_swapped (window_drag->handler, "event",
|
||||
G_CALLBACK (on_window_drag_event), window_drag);
|
||||
clutter_actor_add_child (stage, window_drag->handler);
|
||||
|
|
|
@ -493,7 +493,9 @@ switch_workspace (MetaPlugin *plugin,
|
|||
&screen_height);
|
||||
|
||||
workspace1 = clutter_actor_new ();
|
||||
clutter_actor_set_accessible_name (workspace1, "Workspace 1");
|
||||
workspace2 = clutter_actor_new ();
|
||||
clutter_actor_set_accessible_name (workspace2, "Workspace 2");
|
||||
|
||||
clutter_actor_set_pivot_point (workspace1, 1.0, 1.0);
|
||||
clutter_actor_set_size (workspace1,
|
||||
|
|
Loading…
Reference in a new issue