Adapt to pick changes

It turns out, StViewport's pick implementation was broken, since
Clutter stopped reading clipping from the framebuffer. Rejoice with
bugfixing by removing code!

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1470
This commit is contained in:
Georges Basile Stavracas Neto 2020-10-17 12:34:22 -03:00
parent 0b2430128a
commit 69516a52c6

View File

@ -434,39 +434,24 @@ st_viewport_pick (ClutterActor *actor,
ClutterActorBox allocation_box;
ClutterActorBox content_box;
ClutterActor *child;
CoglFramebuffer *fb = clutter_pick_context_get_framebuffer (pick_context);
get_border_paint_offsets (viewport, &x, &y);
if (x != 0 || y != 0)
{
cogl_framebuffer_push_matrix (fb);
cogl_framebuffer_translate (fb, (int)x, (int)y, 0);
}
CLUTTER_ACTOR_CLASS (st_viewport_parent_class)->pick (actor, pick_context);
if (x != 0 || y != 0)
cogl_framebuffer_pop_matrix (fb);
if (clutter_actor_get_n_children (actor) == 0)
return;
clutter_actor_get_allocation_box (actor, &allocation_box);
st_theme_node_get_content_box (theme_node, &allocation_box, &content_box);
get_border_paint_offsets (viewport, &x, &y);
content_box.x1 += x;
content_box.y1 += y;
content_box.x2 += x;
content_box.y2 += y;
if (priv->hadjustment || priv->vadjustment)
{
cogl_framebuffer_push_rectangle_clip (fb,
(int)content_box.x1,
(int)content_box.y1,
(int)content_box.x2,
(int)content_box.y2);
}
clutter_pick_context_push_clip (pick_context, &content_box);
for (child = clutter_actor_get_first_child (actor);
child != NULL;
@ -474,7 +459,7 @@ st_viewport_pick (ClutterActor *actor,
clutter_actor_pick (child, pick_context);
if (priv->hadjustment || priv->vadjustment)
cogl_framebuffer_pop_clip (fb);
clutter_pick_context_pop_clip (pick_context);
}
static gboolean