@@ -477,11 +477,6 @@ ShouldGenerateWindowCloseOnAltF4(void)
477477 return !SDL_GetHintBoolean (SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 , SDL_FALSE );
478478}
479479
480- /* Win10 "Fall Creators Update" introduced the bug that SetCursorPos() (as used by SDL_WarpMouseInWindow())
481- doesn't reliably generate WM_MOUSEMOVE events anymore (see #3931) which breaks relative mouse mode via warping.
482- This is used to implement a workaround.. */
483- static SDL_bool isWin10FCUorNewer = SDL_FALSE ;
484-
485480/* We want to generate mouse events from mouse and pen, and touch events from touchscreens */
486481#define MI_WP_SIGNATURE 0xFF515700
487482#define MI_WP_SIGNATURE_MASK 0xFFFFFF00
@@ -581,7 +576,7 @@ WarpWithinBoundsRect(int x, int y, RECT *bounds)
581576 } else {
582577 warpY = SDL_clamp (y , targetTop , targetBottom );
583578 }
584- SetCursorPos (warpX , warpY );
579+ WIN_SetCursorPos (warpX , warpY );
585580 }
586581 }
587582}
@@ -752,18 +747,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
752747 if (GetMouseMessageSource () != SDL_MOUSE_EVENT_SOURCE_TOUCH &&
753748 lParam != data -> last_pointer_update ) {
754749 SDL_SendMouseMotion (data -> window , 0 , 0 , GET_X_LPARAM (lParam ), GET_Y_LPARAM (lParam ));
755- if (isWin10FCUorNewer && mouse -> relative_mode_warp &&
756- (data -> window -> flags & SDL_WINDOW_INPUT_FOCUS ) != 0 ) {
757- /* To work around #3931, Win10 bug introduced in Fall Creators Update, where
758- SetCursorPos() (SDL_WarpMouseInWindow()) doesn't reliably generate mouse events anymore,
759- after each windows mouse event generate a fake event for the middle of the window
760- if relative_mode_warp is used */
761- int center_x = 0 , center_y = 0 ;
762- SDL_GetWindowSize (data -> window , & center_x , & center_y );
763- center_x /= 2 ;
764- center_y /= 2 ;
765- SDL_SendMouseMotion (data -> window , 0 , 0 , center_x , center_y );
766- }
767750 }
768751 }
769752 }
@@ -1703,8 +1686,6 @@ SDL_RegisterApp(char *name, Uint32 style, void *hInst)
17031686 return SDL_SetError ("Couldn't register application class" );
17041687 }
17051688
1706- isWin10FCUorNewer = IsWin10FCUorNewer ();
1707-
17081689 app_registered = 1 ;
17091690 return 0 ;
17101691}
0 commit comments