mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-23 05:51:01 +00:00
Turn off relative mouse before window checks as well
This commit is contained in:
parent
e2d268a399
commit
795744fc75
|
@ -263,10 +263,13 @@ Cocoa_SetRelativeMouseMode(SDL_bool enabled)
|
|||
if (enabled) {
|
||||
DLog("Turning on.");
|
||||
result = CGAssociateMouseAndMouseCursorPosition(NO);
|
||||
} else {
|
||||
DLog("Turning off.");
|
||||
result = CGAssociateMouseAndMouseCursorPosition(YES);
|
||||
}
|
||||
if (result != kCGErrorSuccess) {
|
||||
return SDL_SetError("CGAssociateMouseAndMouseCursorPosition() failed");
|
||||
}
|
||||
}
|
||||
|
||||
/* We will re-apply the non-relative mode when the window gets focus, if it
|
||||
* doesn't have focus right now.
|
||||
|
@ -284,15 +287,6 @@ Cocoa_SetRelativeMouseMode(SDL_bool enabled)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
DLog("Turning off.");
|
||||
result = CGAssociateMouseAndMouseCursorPosition(YES);
|
||||
if (result != kCGErrorSuccess) {
|
||||
return SDL_SetError("CGAssociateMouseAndMouseCursorPosition() failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The hide/unhide calls are redundant most of the time, but they fix
|
||||
* https://bugzilla.libsdl.org/show_bug.cgi?id=2550
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue