From 1fee2a9ae0de6004d67d010075d5136766682d4b Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Sun, 28 Dec 2025 12:42:09 -0500
Subject: [PATCH] wayland: Remove redundant mouse button releases
Any pressed buttons are released in the loop when the pointer leaves a surface, so no need to release them again.
---
src/video/wayland/SDL_waylandevents.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c
index 1755813297caf..2468ede2c919c 100644
--- a/src/video/wayland/SDL_waylandevents.c
+++ b/src/video/wayland/SDL_waylandevents.c
@@ -877,11 +877,6 @@ static void pointer_handle_leave(void *data, struct wl_pointer *pointer,
seat->pointer.buttons_pressed &= ~SDL_BUTTON_MASK(i);
}
}
- SDL_SendMouseButton(0, window->sdlwindow, seat->pointer.sdl_id, SDL_BUTTON_LEFT, false);
- SDL_SendMouseButton(0, window->sdlwindow, seat->pointer.sdl_id, SDL_BUTTON_RIGHT, false);
- SDL_SendMouseButton(0, window->sdlwindow, seat->pointer.sdl_id, SDL_BUTTON_MIDDLE, false);
- SDL_SendMouseButton(0, window->sdlwindow, seat->pointer.sdl_id, SDL_BUTTON_X1, false);
- SDL_SendMouseButton(0, window->sdlwindow, seat->pointer.sdl_id, SDL_BUTTON_X2, false);
/* A pointer leave event may be emitted if the compositor hides the pointer in response to receiving a touch event.
* Don't relinquish focus if the surface has active touches, as the compositor is just transitioning from mouse to touch mode.