diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-03-20 16:08:21 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-03-20 16:08:21 +0000 |
commit | cd4c50db38ea9421deb83f25935a27531aa756a9 (patch) | |
tree | d953534985e4810ccc171b212660ffeda1b24c49 | |
parent | 6dd50fcdf722c6be12c060d3696635b0cdd16221 (diff) | |
download | clutter-cd4c50db38ea9421deb83f25935a27531aa756a9.tar.gz |
wayland: Protect against enter events for empty surfaces
The `leave` handler checks for NULL surfaces, but the `enter` handler
does not.
Fixes: #17
-rw-r--r-- | clutter/wayland/clutter-input-device-wayland.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clutter/wayland/clutter-input-device-wayland.c b/clutter/wayland/clutter-input-device-wayland.c index 7bfb615b7..3dab22070 100644 --- a/clutter/wayland/clutter-input-device-wayland.c +++ b/clutter/wayland/clutter-input-device-wayland.c @@ -472,7 +472,10 @@ clutter_wayland_handle_keyboard_enter (void *data, struct wl_array *keys) { ClutterInputDeviceWayland *device = data; - ClutterStageCogl *stage_cogl; + ClutterStageCogl *stage_cogl; + + if (surface == NULL) + return; if (!CLUTTER_IS_STAGE_COGL (wl_surface_get_user_data (surface))) return; @@ -495,8 +498,9 @@ clutter_wayland_handle_keyboard_leave (void *data, ClutterInputDeviceWayland *device = data; ClutterStageCogl *stage_cogl; - if (!surface) + if (surface == NULL) return; + if (!CLUTTER_IS_STAGE_COGL (wl_surface_get_user_data (surface))) return; |