Browse Source

Fix Mouse button index

(cherry picked from commit c9baf208bd36ce9a7f2df330e8b398fe96be18ed)
Mathieu Eyraud 1 month ago
parent
commit
0394e2e583
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/video/wayland/SDL_waylandevents.c

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

@@ -871,7 +871,7 @@ static void pointer_handle_leave(void *data, struct wl_pointer *pointer,
 
     SDL_WaylandSeat *seat = (SDL_WaylandSeat *)data;
     seat->pointer.focus = NULL;
-    for (int i = 0; seat->pointer.buttons_pressed; ++i) {
+    for (int i = 1; seat->pointer.buttons_pressed; ++i) {
         if (seat->pointer.buttons_pressed & SDL_BUTTON_MASK(i)) {
             SDL_SendMouseButton(0, window->sdlwindow, seat->pointer.sdl_id, i, false);
             seat->pointer.buttons_pressed &= ~SDL_BUTTON_MASK(i);