Re: [PATCH weston] window: Check for NULL surface in keyboard_handle_enter

2017-01-17 Thread Daniel Stone
Hi Dima,

On 30 November 2016 at 20:10, Dima Ryazanov  wrote:
> This can happen if you right-click in weston-terminal a few times very 
> quickly.
> The pointer_handle_enter callback already checks for NULL, so let's do that in
> keyboard_handle_enter, too.

Good catch, thanks! Pushed with review:
To ssh://git.freedesktop.org/git/wayland/weston
   db776db..3b7c207  push -> master

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] window: Check for NULL surface in keyboard_handle_enter

2016-11-30 Thread Dima Ryazanov
This can happen if you right-click in weston-terminal a few times very quickly.
The pointer_handle_enter callback already checks for NULL, so let's do that in
keyboard_handle_enter, too.

Signed-off-by: Dima Ryazanov 
---
 clients/window.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/clients/window.c b/clients/window.c
index ac35c3d..afc7cab 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3084,6 +3084,11 @@ keyboard_handle_enter(void *data, struct wl_keyboard 
*keyboard,
struct input *input = data;
struct window *window;
 
+   if (!surface) {
+   /* enter event for a window we've just destroyed */
+   return;
+   }
+
input->display->serial = serial;
input->keyboard_focus = wl_surface_get_user_data(surface);
 
-- 
2.9.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel