summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-03-31 22:01:53 +0000
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-03-31 23:13:42 +0000
commit6f9b5edd4deeb412e644122ce2f15b3d593bd07a (patch)
tree71532fea4300e90c5e2c83bfd16b5507752cd3cc
parent31809e121424ec6609e947ab2d6bde6ae792b539 (diff)
downloadmutter-6f9b5edd4deeb412e644122ce2f15b3d593bd07a.tar.gz
tests/actor-pick: Allocate actor before picking
Picking now only happens on allocated actors, but the callback in the actor-pick test is not waiting for the stage to run an allocation cycle. Ideally, we'd wait for this cycle, but for now, forcing an allocation works as well. Allocate the overlay actor in the actor-pick test. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169 (cherry picked from commit 7f488e3e1d13f54ff1bbc9b43ee64cd2dfa82905)
-rw-r--r--src/tests/clutter/conform/actor-pick.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tests/clutter/conform/actor-pick.c b/src/tests/clutter/conform/actor-pick.c
index 53ac8ec5a..dcee96424 100644
--- a/src/tests/clutter/conform/actor-pick.c
+++ b/src/tests/clutter/conform/actor-pick.c
@@ -67,6 +67,9 @@ on_timeout (gpointer data)
}
else if (test_num == 2)
{
+ ClutterActorBox over_actor_box =
+ CLUTTER_ACTOR_BOX_INIT (0, 0, STAGE_WIDTH, STAGE_HEIGHT);
+
/* Make the actor visible but set a clip so that only some
of the actors are accessible */
clutter_actor_show (over_actor);
@@ -76,6 +79,11 @@ on_timeout (gpointer data)
state->actor_width * (ACTORS_X - 4),
state->actor_height * (ACTORS_Y - 4));
+ /* Only allocated actors can be picked, so force an allocation
+ * of the overlay actor here.
+ */
+ clutter_actor_allocate (over_actor, &over_actor_box, 0);
+
if (g_test_verbose ())
g_print ("Clipped covering actor:\n");
}