tests/ref-test: Inhibit hardware cursors for ref tests

We run some ref-tests in the tty and kms test harnesses which does
support cursor planes. If we get "unlucky", the cursor could end up on
one of them and won't show up in the captured output.

Inhibit the hardware cursor when capturing the output for a ref-test.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4307>
This commit is contained in:
Sebastian Wick 2025-02-28 16:42:05 +01:00 committed by Marge Bot
parent 4a0b672146
commit b126b01490
2 changed files with 4 additions and 0 deletions

View File

@ -246,8 +246,10 @@ void meta_backend_add_hw_cursor_inhibitor (MetaBackend *backend,
void meta_backend_remove_hw_cursor_inhibitor (MetaBackend *backend,
MetaHwCursorInhibitor *inhibitor);
META_EXPORT_TEST
void meta_backend_inhibit_hw_cursor (MetaBackend *backend);
META_EXPORT_TEST
void meta_backend_uninhibit_hw_cursor (MetaBackend *backend);
META_EXPORT_TEST

View File

@ -158,6 +158,7 @@ capture_view (ClutterStageView *stage_view)
CaptureViewData data = { 0 };
meta_compositor_disable_unredirect (compositor);
meta_backend_inhibit_hw_cursor (backend);
data.loop = g_main_loop_new (NULL, FALSE);
data.watch = meta_stage_watch_view (stage, stage_view,
@ -173,6 +174,7 @@ capture_view (ClutterStageView *stage_view)
g_assert_null (data.watch);
g_assert_nonnull (data.out_image);
meta_backend_uninhibit_hw_cursor (backend);
meta_compositor_enable_unredirect (compositor);
return data.out_image;