cursor-renderer: Make 'handled_by_backend' state 'needs_overlay'

This will, conceptually, and eventually, allow a backend to both want an
overlay, while still handling it by default.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
This commit is contained in:
Jonas Ådahl 2022-12-21 18:28:35 +01:00
parent 3b2f95cb1f
commit 5d35138df0
4 changed files with 10 additions and 10 deletions

View File

@ -65,7 +65,7 @@ struct _MetaCursorRendererPrivate
MetaCursorSprite *overlay_cursor;
MetaOverlay *stage_overlay;
gboolean handled_by_backend;
gboolean needs_overlay;
gulong after_paint_handler_id;
GList *hw_cursor_inhibitors;
@ -157,7 +157,7 @@ meta_cursor_renderer_update_stage_overlay (MetaCursorRenderer *renderer,
meta_cursor_sprite_get_texture_transform (cursor_sprite);
}
meta_overlay_set_visible (priv->stage_overlay, !priv->handled_by_backend);
meta_overlay_set_visible (priv->stage_overlay, priv->needs_overlay);
meta_stage_update_cursor_overlay (META_STAGE (stage), priv->stage_overlay,
texture, &rect, buffer_transform);
}
@ -171,7 +171,7 @@ meta_cursor_renderer_after_paint (ClutterStage *stage,
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
if (priv->displayed_cursor && !priv->handled_by_backend)
if (priv->displayed_cursor && priv->needs_overlay)
{
graphene_rect_t rect;
MetaRectangle view_layout;
@ -411,7 +411,7 @@ meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
(int) priv->current_y);
}
priv->handled_by_backend =
priv->needs_overlay =
META_CURSOR_RENDERER_GET_CLASS (renderer)->update_cursor (renderer,
cursor_sprite);

View File

@ -1113,7 +1113,7 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *renderer,
schedule_sync_position (native);
clutter_stage_schedule_update (stage);
return (priv->has_hw_cursor ||
return !(priv->has_hw_cursor ||
!cursor_sprite ||
!meta_cursor_sprite_get_cogl_texture (cursor_sprite));
}

View File

@ -55,7 +55,7 @@ meta_cursor_renderer_x11_update_cursor (MetaCursorRenderer *renderer,
{
if (cursor_sprite)
meta_cursor_sprite_realize_texture (cursor_sprite);
return FALSE;
return TRUE;
}
gboolean has_server_cursor = FALSE;
@ -93,7 +93,7 @@ meta_cursor_renderer_x11_update_cursor (MetaCursorRenderer *renderer,
if (cursor_sprite)
meta_cursor_sprite_realize_texture (cursor_sprite);
return priv->server_cursor_visible;
return !priv->server_cursor_visible;
}
static void

View File

@ -44,7 +44,7 @@ meta_cursor_renderer_x11_nested_update_cursor (MetaCursorRenderer *renderer,
{
if (cursor_sprite)
meta_cursor_sprite_realize_texture (cursor_sprite);
return FALSE;
return TRUE;
}
static Cursor