From 208da2316d956e8b658000c25792c5dca2cb1727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 5 Mar 2015 12:15:51 +0800 Subject: [PATCH] wayland: Fix subsurface place_above/below type cast error A MetaWaylandSurface was casted into a ClutterActor, but it should have been the MetaSurfaceActor. Move out parent_actor and surface_actor out of the loop while at it since they won't change when iterating. https://bugzilla.gnome.org/show_bug.cgi?id=745655 --- src/wayland/meta-wayland-surface.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index b116bada8..fe0daffba 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -430,11 +430,15 @@ parent_surface_state_applied (gpointer data, gpointer user_data) if (surface->sub.pending_placement_ops) { GSList *it; + MetaWaylandSurface *parent = surface->sub.parent; + ClutterActor *parent_actor = + clutter_actor_get_parent (CLUTTER_ACTOR (parent->surface_actor)); + ClutterActor *surface_actor = + surface_actor = CLUTTER_ACTOR (surface->surface_actor); + for (it = surface->sub.pending_placement_ops; it; it = it->next) { MetaWaylandSubsurfacePlacementOp *op = it->data; - ClutterActor *surface_actor; - ClutterActor *parent_actor; ClutterActor *sibling_actor; if (!op->sibling) @@ -443,8 +447,6 @@ parent_surface_state_applied (gpointer data, gpointer user_data) continue; } - surface_actor = CLUTTER_ACTOR (surface->surface_actor); - parent_actor = clutter_actor_get_parent (CLUTTER_ACTOR (surface->sub.parent)); sibling_actor = CLUTTER_ACTOR (op->sibling->surface_actor); switch (op->placement)