فهرست منبع

SDL_UpdateFullscreenMode: Only restore mouse position when exiting fullscreen if the fullscreen mode actually changed

- Previously we would skip most of UpdateFullscreenMode if not entering fullscreen and the window was not set as fullscreen for any display
  which prevented running this.

This prevents warping the mouse when hiding a non-fullscreen window
Sam Lantinga 2 سال پیش
والد
کامیت
8d9c7d8ebe
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      src/video/SDL_video.c

+ 4 - 2
src/video/SDL_video.c

@@ -1745,8 +1745,10 @@ int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen, SDL_bool c
                 }
             }
 
-            /* Restore the cursor position */
-            SDL_RestoreMousePosition(window);
+            /* Restore the cursor position if we've exited fullscreen on a display */
+            if (display) {
+                SDL_RestoreMousePosition(window);
+            }
         }
     }