backend: Pass stage view to cursor-painted signal

Will be used for presentation-time handling.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
This commit is contained in:
Ivan Molodetskikh 2021-02-02 16:49:56 +03:00 committed by Marge Bot
parent 2ce3a050f0
commit cd9ae13465
4 changed files with 17 additions and 7 deletions

View File

@ -97,9 +97,10 @@ meta_hw_cursor_inhibitor_default_init (MetaHwCursorInhibitorInterface *iface)
void
meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
MetaCursorSprite *cursor_sprite,
ClutterStageView *stage_view)
{
g_signal_emit (renderer, signals[CURSOR_PAINTED], 0, cursor_sprite);
g_signal_emit (renderer, signals[CURSOR_PAINTED], 0, cursor_sprite, stage_view);
}
static void
@ -177,7 +178,11 @@ meta_cursor_renderer_after_paint (ClutterStage *stage,
clutter_stage_view_get_layout (stage_view, &view_layout);
view_rect = meta_rectangle_to_graphene_rect (&view_layout);
if (graphene_rect_intersection (&rect, &view_rect, NULL))
meta_cursor_renderer_emit_painted (renderer, priv->displayed_cursor);
{
meta_cursor_renderer_emit_painted (renderer,
priv->displayed_cursor,
stage_view);
}
}
}
@ -308,8 +313,9 @@ meta_cursor_renderer_class_init (MetaCursorRendererClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1,
G_TYPE_POINTER);
G_TYPE_NONE, 2,
G_TYPE_POINTER,
CLUTTER_TYPE_STAGE_VIEW);
}
static void

View File

@ -72,7 +72,8 @@ graphene_rect_t meta_cursor_renderer_calculate_rect (MetaCursorRenderer *rendere
MetaCursorSprite *cursor_sprite);
void meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);
MetaCursorSprite *cursor_sprite,
ClutterStageView *stage_view);
ClutterInputDevice * meta_cursor_renderer_get_input_device (MetaCursorRenderer *renderer);
void meta_cursor_renderer_update_stage_overlay (MetaCursorRenderer *renderer,

View File

@ -564,7 +564,9 @@ meta_cursor_renderer_native_prepare_frame (MetaCursorRendererNative *cursor_rend
set_crtc_cursor (cursor_renderer_native, view, crtc, cursor_sprite);
meta_cursor_renderer_emit_painted (cursor_renderer, cursor_sprite);
meta_cursor_renderer_emit_painted (cursor_renderer,
cursor_sprite,
CLUTTER_STAGE_VIEW (view));
crtc_cursor_data->needs_sync_position = FALSE;
crtc_cursor_data->hw_state_invalidated = FALSE;

View File

@ -334,6 +334,7 @@ meta_wayland_cursor_surface_get_hotspot (MetaWaylandCursorSurface *cursor_surfac
static void
on_cursor_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *displayed_sprite,
ClutterStageView *stage_view,
MetaWaylandCursorSurface *cursor_surface)
{
MetaWaylandCursorSurfacePrivate *priv =