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

From 55ba268e66c1f511b64c27bf072b27f0999651b2 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Thu, 15 Jan 2026 21:47:15 -0500
Subject: [PATCH] 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.
---
 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 66c4532c181f2..cec8786127eb7 100644
--- a/src/video/wayland/SDL_waylandevents.c
+++ b/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);