1
0
Fork 0

clutter/stage: Expose stage view getter helper as API

Non-introspected and private to mutter, for getting a stage view from a
coordinate.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/610
This commit is contained in:
Jonas Ådahl 2019-05-06 15:23:30 +02:00
parent e48c7c009a
commit 4abca411f3
2 changed files with 13 additions and 5 deletions

View file

@ -43,6 +43,11 @@ void clutter_stage_capture_into (ClutterStage *stage,
cairo_rectangle_int_t *rect,
uint8_t *data);
CLUTTER_EXPORT
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
float x,
float y);
CLUTTER_EXPORT
void clutter_stage_freeze_updates (ClutterStage *stage);

View file

@ -1586,10 +1586,13 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
return retval;
}
static ClutterStageView *
get_view_at (ClutterStage *stage,
float x,
float y)
/**
* clutter_stage_get_view_at: (skip)
*/
ClutterStageView *
clutter_stage_get_view_at (ClutterStage *stage,
float x,
float y)
{
ClutterStagePrivate *priv = stage->priv;
GList *l;
@ -1636,7 +1639,7 @@ _clutter_stage_do_pick (ClutterStage *stage,
if (x < 0 || x >= stage_width || y < 0 || y >= stage_height)
return actor;
view = get_view_at (stage, x, y);
view = clutter_stage_get_view_at (stage, x, y);
if (view)
return _clutter_stage_do_pick_on_view (stage, x, y, mode, view);