tests/cursor: Embed a copy of the Adwaita cursor theme

As a follow-up to 87cc6633a5, embed a partial copy of the Adwaita cursor theme
and point to it with XCURSOR_PATH to make the test completely independent
from the installed cursor themes.

Indeed, adwaita-icon-theme changed ever so slightly in version 48 so the
ref tests started failing when the new version was installed.

This is a copy of adwaita-icon-theme 47, which is what was used to generate
the ref images.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4252>
This commit is contained in:
Alessandro Astone 2025-02-06 16:46:38 +01:00 committed by Marge Bot
parent eeaff29264
commit f31539984d
5 changed files with 6 additions and 1 deletions

View File

@ -672,6 +672,7 @@ main (int argc,
char **argv)
{
g_autoptr (MetaContext) context = NULL;
g_autofree char *path = NULL;
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_TEST,
(META_CONTEXT_TEST_FLAG_NO_X11 |
@ -681,6 +682,9 @@ main (int argc,
meta_context_test_set_background_color (META_CONTEXT_TEST (context),
COGL_COLOR_INIT (255, 255, 255, 255));
path = g_test_build_filename (G_TEST_DIST, "tests", "xcursors", NULL);
g_setenv ("XCURSOR_PATH", path, TRUE);
test_context = context;
init_tests ();

View File

@ -1091,6 +1091,7 @@ if have_installed_tests
install_subdir('migration', install_dir: tests_datadir)
install_subdir('ref-tests', install_dir: tests_datadir)
install_subdir('icc-profiles', install_dir: tests_datadir)
install_subdir('xcursors', install_dir: tests_datadir)
install_data('org.gnome.mutter.test.gschema.xml', install_dir: tests_datadir)

View File

@ -127,7 +127,7 @@ on_pointer_enter (WaylandSurface *surface,
"and actual scale %f",
effective_theme_size, theme_size, scale);
cursor_theme = wl_cursor_theme_load ("Adwaita",
cursor_theme = wl_cursor_theme_load (NULL,
effective_theme_size,
display->shm);
cursor = wl_cursor_theme_get_cursor (cursor_theme, cursor_name);

Binary file not shown.

Binary file not shown.