Wayland: Fixed fault in event handling which might have caused a crash someday.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 02 Mar 2016 20:25:23 +0100
changeset 10099 c7932bb6dcee
parent 10098 91b34fbbb88e
child 10100 a18ec339c8d3
Wayland: Fixed fault in event handling which might have caused a crash someday. Found by Cppcheck.
src/video/wayland/SDL_waylandevents.c
--- a/src/video/wayland/SDL_waylandevents.c	Wed Mar 02 20:25:09 2016 +0100
+++ b/src/video/wayland/SDL_waylandevents.c	Wed Mar 02 20:25:23 2016 +0100
@@ -302,9 +302,9 @@
  
     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);
     }
 }