mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-13 20:50:29 +00:00
Added RIDEV_NOLEGACY to improve performance in mouse relative mode (thanks @whrvt!)
This change also makes it so relative mode doesn't kick in until the mouse enters the window client area. This prevents relative mode from kicking in while clicking and dragging on the title bar, etc.
This commit is contained in:
@@ -4416,10 +4416,12 @@ void SDL_OnWindowEnter(SDL_Window *window)
|
||||
if (_this->OnWindowEnter) {
|
||||
_this->OnWindowEnter(_this, window);
|
||||
}
|
||||
SDL_UpdateRelativeMouseMode();
|
||||
}
|
||||
|
||||
void SDL_OnWindowLeave(SDL_Window *window)
|
||||
{
|
||||
SDL_UpdateRelativeMouseMode();
|
||||
}
|
||||
|
||||
void SDL_OnWindowFocusGained(SDL_Window *window)
|
||||
|
||||
@@ -98,7 +98,7 @@ static bool UpdateRawInputDeviceFlags(HWND window, Uint32 last_flags, Uint32 new
|
||||
devices[count].usUsage = USB_USAGE_GENERIC_MOUSE;
|
||||
|
||||
if (new_flags & ENABLE_RAW_MOUSE_INPUT) {
|
||||
devices[count].dwFlags = 0;
|
||||
devices[count].dwFlags = RIDEV_NOLEGACY;
|
||||
devices[count].hwndTarget = window;
|
||||
} else {
|
||||
devices[count].dwFlags = RIDEV_REMOVE;
|
||||
|
||||
Reference in New Issue
Block a user