shell: Fix crash when a client is destroyed during the resize grab

If a client exists during a resize grab, the resource for the shell
surface being resized is destroyed. The shell surface is not destroyed
immediately, however, because of the window close animation. In that
case, the compositor would crash trying to send configure events to
the surface being resized, since it would pass a NULL pointer to
wl_resource_post_event().

The code for the resize grab was already able to handle the surface
going away, so expand it to also handle the resource going away and
fix the crash.

https://bugs.freedesktop.org/show_bug.cgi?id=77344
dev
Ander Conselvan de Oliveira 11 years ago committed by Kristian Høgsberg
parent 15f9a26bb1
commit 9c376b54ea
  1. 2
      desktop-shell/shell.c

@ -1594,7 +1594,7 @@ resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
weston_pointer_move(pointer, x, y); weston_pointer_move(pointer, x, y);
if (!shsurf) if (!shsurf || !shsurf->resource)
return; return;
weston_view_from_global_fixed(shsurf->view, weston_view_from_global_fixed(shsurf->view,

Loading…
Cancel
Save