diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index aac23ac7c..34b447539 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3559,8 +3559,7 @@ rotate_grab_motion(struct weston_pointer_grab *grab, container_of(grab, struct rotate_grab, base.grab); struct weston_pointer *pointer = grab->pointer; struct shell_surface *shsurf = rotate->base.shsurf; - struct weston_surface *surface = - weston_desktop_surface_get_surface(shsurf->desktop_surface); + struct weston_surface *surface; float cx, cy, dx, dy, cposx, cposy, dposx, dposy, r; weston_pointer_move(pointer, event); @@ -3568,6 +3567,8 @@ rotate_grab_motion(struct weston_pointer_grab *grab, if (!shsurf) return; + surface = weston_desktop_surface_get_surface(shsurf->desktop_surface); + cx = 0.5f * surface->width; cy = 0.5f * surface->height;