cursor-renderer/native: Use the existing inhibit logic without hw cursor

By setting cursor_stage_view->is_hw_cursor_valid and has_hw_cursor and
then skipping to the code below, we can reuse all the logic for when we
need to inhibit/uninhibit and update the sprite.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4307>
This commit is contained in:
Sebastian Wick
2025-02-28 16:42:45 +01:00
committed by Marge Bot
parent d32f63acc5
commit 1e28542270

View File

@@ -363,15 +363,10 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer,
!is_hw_cursor_available_for_gpu (META_GPU_KMS (gpu)) ||
!meta_crtc_native_is_hw_cursor_supported (crtc_native))
{
if (cursor_stage_view->has_hw_cursor)
{
meta_stage_view_uninhibit_cursor_overlay (view);
cursor_stage_view->has_hw_cursor = FALSE;
cursor_stage_view->is_hw_cursor_valid = TRUE;
has_hw_cursor = FALSE;
}
continue;
}
if (cursor_sprite && !meta_backend_is_hw_cursors_inhibited (backend))
else if (cursor_sprite && !meta_backend_is_hw_cursors_inhibited (backend))
{
meta_cursor_sprite_realize_texture (cursor_sprite);