}
}
+static struct shell_surface *
+find_toplevel_surface(struct shell_surface *in_surface)
+{
+ struct shell_surface *surface = in_surface;
+
+ if (!surface)
+ return NULL;
+
+ while (surface->parent)
+ surface = get_shell_surface(surface->parent);
+
+ /* If no top level surface was found, just use whatever surface was
+ originally provided. */
+ if (!surface || surface->type != SHELL_SURFACE_TOPLEVEL)
+ surface = in_surface;
+
+ return surface;
+}
+
static void
send_configure_for_surface(struct shell_surface *shsurf)
{
if (!shsurf)
return -1;
+ shsurf = find_toplevel_surface(shsurf);
+
if (shsurf->grabbed ||
shsurf->state.fullscreen || shsurf->state.maximized)
return 0;
float dx, dy;
float r;
+ surface = find_toplevel_surface(surface);
+
rotate = malloc(sizeof *rotate);
if (!rotate)
return;