From be34036ed7b6ec9c507395831b2ec7b0554187e6 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Wed, 2 Mar 2016 20:25:23 +0100 Subject: [PATCH] Wayland: Fixed fault in event handling which might have caused a crash someday. Found by Cppcheck. --- src/video/wayland/SDL_waylandevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 53b0ac9078a56..8a645c4681f49 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -302,9 +302,9 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, window = wl_surface_get_user_data(surface); - input->keyboard_focus = window; - window->keyboard_device = input; if (window) { + input->keyboard_focus = window; + window->keyboard_device = input; SDL_SetKeyboardFocus(window->sdlwindow); } }