Browse Source

Reset SDL's internal in_title_click variable whenever a normal mouse up/down event is received. Fixes #1151.

Lasse Öörni 10 years ago
parent
commit
c46f414034
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Source/ThirdParty/SDL/src/video/windows/SDL_windowsevents.c

+ 4 - 0
Source/ThirdParty/SDL/src/video/windows/SDL_windowsevents.c

@@ -419,6 +419,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
     case WM_MBUTTONDOWN:
     case WM_XBUTTONDOWN:
         {
+            // Urho3D: in_title_click may be erroneously left on with non-Aero styles, causing the hidden mouse centering to stop working.
+            // To work around, reset whenever a normal mouse button up/down event is received
+            data->in_title_click = SDL_FALSE;
+
             SDL_Mouse *mouse = SDL_GetMouse();
             if (!emulatedMouse && (!mouse->relative_mode || mouse->relative_mode_warp)) {
                 WIN_CheckWParamMouseButtons(wParam, data);