1
0
Fork 0

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:
Bilal Elmoussaoui 2024-08-05 15:04:38 +02:00 committed by Marge Bot
parent 6874e98e5d
commit ec028553d3
11 changed files with 29 additions and 4 deletions

View file

@ -266,7 +266,10 @@ clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
ClutterActor * ClutterActor *
clutter_scroll_actor_new (void) 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);
} }
/** /**

View file

@ -337,6 +337,7 @@ meta_stage_new (MetaBackend *backend)
stage = g_object_new (META_TYPE_STAGE, stage = g_object_new (META_TYPE_STAGE,
"context", meta_backend_get_clutter_context (backend), "context", meta_backend_get_clutter_context (backend),
"accessible-name", "Main stage",
NULL); NULL);
stage->backend = backend; stage->backend = backend;

View file

@ -334,8 +334,11 @@ meta_compositor_manage (MetaCompositor *compositor,
compositor); compositor);
priv->window_group = meta_window_group_new (display); 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); 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); 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->window_group);
clutter_actor_add_child (stage, priv->top_window_group); clutter_actor_add_child (stage, priv->top_window_group);
@ -379,18 +382,21 @@ meta_compositor_add_window (MetaCompositor *compositor,
MetaWindowActor *window_actor; MetaWindowActor *window_actor;
ClutterActor *window_group; ClutterActor *window_group;
GType window_actor_type = G_TYPE_INVALID; GType window_actor_type = G_TYPE_INVALID;
const char *accessible_name = NULL;
switch (window->client_type) switch (window->client_type)
{ {
#ifdef HAVE_X11_CLIENT #ifdef HAVE_X11_CLIENT
case META_WINDOW_CLIENT_TYPE_X11: case META_WINDOW_CLIENT_TYPE_X11:
window_actor_type = META_TYPE_WINDOW_ACTOR_X11; window_actor_type = META_TYPE_WINDOW_ACTOR_X11;
accessible_name = "X11 window";
break; break;
#endif #endif
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND
case META_WINDOW_CLIENT_TYPE_WAYLAND: case META_WINDOW_CLIENT_TYPE_WAYLAND:
window_actor_type = META_TYPE_WINDOW_ACTOR_WAYLAND; window_actor_type = META_TYPE_WINDOW_ACTOR_WAYLAND;
accessible_name = "Wayland window";
break; break;
#endif #endif
@ -400,6 +406,7 @@ meta_compositor_add_window (MetaCompositor *compositor,
window_actor = g_object_new (window_actor_type, window_actor = g_object_new (window_actor_type,
"meta-window", window, "meta-window", window,
"accessible-name", accessible_name,
"show-on-set-parent", FALSE, "show-on-set-parent", FALSE,
NULL); NULL);
@ -1331,6 +1338,7 @@ meta_compositor_flash_display (MetaCompositor *compositor,
clutter_actor_get_size (stage, &width, &height); clutter_actor_get_size (stage, &width, &height);
flash = clutter_actor_new (); 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_background_color (flash, &COGL_COLOR_INIT (0, 0, 0, 255));
clutter_actor_set_size (flash, width, height); clutter_actor_set_size (flash, width, height);
clutter_actor_set_opacity (flash, 0); clutter_actor_set_opacity (flash, 0);
@ -1370,6 +1378,7 @@ meta_compositor_flash_window (MetaCompositor *compositor,
ClutterTransition *transition; ClutterTransition *transition;
flash = clutter_actor_new (); 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_background_color (flash, &COGL_COLOR_INIT (0, 0, 0, 255));
clutter_actor_set_size (flash, window->rect.width, window->rect.height); clutter_actor_set_size (flash, window->rect.width, window->rect.height);
clutter_actor_set_position (flash, clutter_actor_set_position (flash,

View file

@ -157,6 +157,7 @@ meta_background_actor_new (MetaDisplay *display,
self = g_object_new (META_TYPE_BACKGROUND_ACTOR, self = g_object_new (META_TYPE_BACKGROUND_ACTOR,
"meta-display", display, "meta-display", display,
"monitor", monitor, "monitor", monitor,
"accessible-name", "Background actor",
NULL); NULL);
return CLUTTER_ACTOR (self); return CLUTTER_ACTOR (self);

View file

@ -60,7 +60,9 @@ meta_background_group_new (void)
{ {
MetaBackgroundGroup *background_group; 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); return CLUTTER_ACTOR (background_group);
} }

View file

@ -161,6 +161,7 @@ meta_dnd_actor_new (MetaCompositor *compositor,
"drag-origin", drag_origin, "drag-origin", drag_origin,
"drag-start-x", drag_start_x, "drag-start-x", drag_start_x,
"drag-start-y", drag_start_y, "drag-start-y", drag_start_y,
"accessible-name", "Drag and drop actor",
NULL); NULL);
return CLUTTER_ACTOR (self); return CLUTTER_ACTOR (self);

View file

@ -316,7 +316,9 @@ meta_surface_actor_wayland_init (MetaSurfaceActorWayland *self)
MetaSurfaceActor * MetaSurfaceActor *
meta_surface_actor_wayland_new (MetaWaylandSurface *surface) 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 ()); g_assert (meta_is_wayland_compositor ());

View file

@ -419,6 +419,7 @@ meta_surface_actor_x11_new (MetaWindow *window)
sync_unredirected (self); sync_unredirected (self);
clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE); clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
clutter_actor_set_accessible_name (CLUTTER_ACTOR (self), "X11 surface");
return META_SURFACE_ACTOR (self); return META_SURFACE_ACTOR (self);
} }

View file

@ -74,6 +74,7 @@ surface_container_new (MetaWindowActor *window_actor)
MetaSurfaceContainerActorWayland *surface_container; MetaSurfaceContainerActorWayland *surface_container;
surface_container = g_object_new (META_TYPE_SURFACE_CONTAINER_ACTOR_WAYLAND, surface_container = g_object_new (META_TYPE_SURFACE_CONTAINER_ACTOR_WAYLAND,
"accessible-name", "Wayland surface container",
NULL); NULL);
surface_container->window_actor = window_actor; surface_container->window_actor = window_actor;

View file

@ -1845,6 +1845,8 @@ meta_window_drag_begin (MetaWindowDrag *window_drag,
window_drag->handler = clutter_actor_new (); window_drag->handler = clutter_actor_new ();
clutter_actor_set_name (window_drag->handler, clutter_actor_set_name (window_drag->handler,
"Window drag helper"); "Window drag helper");
clutter_actor_set_accessible_name (window_drag->handler,
"Window drag helper");
g_signal_connect_swapped (window_drag->handler, "event", g_signal_connect_swapped (window_drag->handler, "event",
G_CALLBACK (on_window_drag_event), window_drag); G_CALLBACK (on_window_drag_event), window_drag);
clutter_actor_add_child (stage, window_drag->handler); clutter_actor_add_child (stage, window_drag->handler);

View file

@ -493,7 +493,9 @@ switch_workspace (MetaPlugin *plugin,
&screen_height); &screen_height);
workspace1 = clutter_actor_new (); workspace1 = clutter_actor_new ();
clutter_actor_set_accessible_name (workspace1, "Workspace 1");
workspace2 = clutter_actor_new (); 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_pivot_point (workspace1, 1.0, 1.0);
clutter_actor_set_size (workspace1, clutter_actor_set_size (workspace1,