Browse Source

Wayland: Fixed fault in event handling which might have caused a crash someday.

Found by Cppcheck.
Philipp Wiesemann 9 years ago
parent
commit
be34036ed7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/video/wayland/SDL_waylandevents.c

+ 2 - 2
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);
     window = wl_surface_get_user_data(surface);
 
 
-    input->keyboard_focus = window;
-    window->keyboard_device = input;
     if (window) {
     if (window) {
+        input->keyboard_focus = window;
+        window->keyboard_device = input;
         SDL_SetKeyboardFocus(window->sdlwindow);
         SDL_SetKeyboardFocus(window->sdlwindow);
     }
     }
 }
 }