Przeglądaj źródła

wayland: Don't process null leave events in the pointer frame handler

This can cause the cursor to become invisible when passing over libdecor surfaces.
Frank Praznik 1 miesiąc temu
rodzic
commit
55ba268e66
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/video/wayland/SDL_waylandevents.c

+ 2 - 2
src/video/wayland/SDL_waylandevents.c

@@ -1274,7 +1274,7 @@ static void pointer_handle_frame(void *data, struct wl_pointer *pointer)
     SDL_WaylandSeat *seat = data;
 
     if (seat->pointer.pending_frame.enter_window) {
-        if (seat->pointer.pending_frame.leave_window == seat->pointer.focus) {
+        if (seat->pointer.focus && seat->pointer.pending_frame.leave_window == seat->pointer.focus) {
             // Leaving the previous surface before entering a new surface.
             pointer_dispatch_leave(seat);
         }
@@ -1320,7 +1320,7 @@ static void pointer_handle_frame(void *data, struct wl_pointer *pointer)
         pointer_dispatch_axis(seat);
     }
 
-    if (seat->pointer.pending_frame.leave_window == seat->pointer.focus) {
+    if (seat->pointer.focus && seat->pointer.pending_frame.leave_window == seat->pointer.focus) {
         pointer_dispatch_leave(seat);
         Wayland_SeatUpdatePointerGrab(seat);
         Wayland_SeatUpdatePointerCursor(seat);