From 6780073d7815ea92bbe401115824c31ebdcffbd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 4 Jul 2013 01:12:17 -0400 Subject: [PATCH] shell: Always go through end_busy_cursor when ending the busy cursor grab --- src/shell.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/shell.c b/src/shell.c index bbc3d05b..e20004f7 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1293,6 +1293,9 @@ shell_surface_resize(struct wl_client *client, struct wl_resource *resource, wl_resource_post_no_memory(resource); } +static void +end_busy_cursor(struct shell_surface *shsurf, struct weston_pointer *pointer); + static void busy_cursor_grab_focus(struct weston_pointer_grab *base) { @@ -1305,10 +1308,8 @@ busy_cursor_grab_focus(struct weston_pointer_grab *base) pointer->x, pointer->y, &sx, &sy); - if (!grab->shsurf || grab->shsurf->surface != surface) { - shell_grab_end(grab); - free(grab); - } + if (!grab->shsurf || grab->shsurf->surface != surface) + end_busy_cursor(grab->shsurf, pointer); } static void