1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Add workaround for mouse handling bug in Win10 FCU (cherry picked from commit d15e58f3da33c77d015f1af248354b01ca237362)

Author: Adam Johnson <AdamJohnso@gmail.com>
Date:   Sun Mar 25 21:08:57 2018 -0400

    Add workaround for mouse handling bug in Win10 FCU

    Windows 10 Fall Creators Update changed the behavior of SetCursorPos,
    which no longer sends the expected WM_MOUSEMOVE message when
    recentering the cursor.  This adds a function to detect affected
    versions of Windows and flags the necessity to manually send our own
    message.

    This workaround currently only detects the known affected version of
    Win10, in the hope that it will be fixed and no further attention
    will be required.  If this regression is not fixed, additional Win10
    versions can be added.
This commit is contained in:
2020-04-16 11:14:56 -06:00
committed by rarified
parent ec654905ee
commit f8841b8264
3 changed files with 74 additions and 1 deletions

View File

@ -766,3 +766,31 @@ char** DisplaySystemVersion()
return nil;
#endif
}
#ifdef HS_BUILD_FOR_WIN32
static RTL_OSVERSIONINFOW s_WinVer;
const RTL_OSVERSIONINFOW& hsGetWindowsVersion()
{
static bool done = false;
if (!done) {
memset(&s_WinVer, 0, sizeof(RTL_OSVERSIONINFOW));
HMODULE ntdll = LoadLibraryW(L"ntdll.dll");
hsAssert(ntdll, "Failed to LoadLibrary on ntdll???");
if (ntdll) {
s_WinVer.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOW);
typedef LONG(WINAPI* RtlGetVersionPtr)(RTL_OSVERSIONINFOW*);
RtlGetVersionPtr getVersion = (RtlGetVersionPtr)GetProcAddress(ntdll, "RtlGetVersion");
hsAssert(getVersion, "Could not find RtlGetVersion in ntdll");
if (getVersion) {
getVersion(&s_WinVer);
done = true;
}
}
FreeLibrary(ntdll);
}
return s_WinVer;
}
#endif

View File

@ -55,4 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <Windows.h>
#endif // __AFX_H__
const RTL_OSVERSIONINFOW& hsGetWindowsVersion();
#endif // HS_BUILD_FOR_WIN32