mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 16:55:35 +00:00
Minor cleanup
This commit is contained in:
parent
86acb1a347
commit
27fc582b59
|
@ -561,7 +561,6 @@ SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state
|
||||||
Uint32 type;
|
Uint32 type;
|
||||||
Uint32 buttonstate;
|
Uint32 buttonstate;
|
||||||
SDL_MouseInputSource *source;
|
SDL_MouseInputSource *source;
|
||||||
SDL_bool had_buttons_pressed = (SDL_GetMouseState(NULL, NULL) ? SDL_TRUE : SDL_FALSE);
|
|
||||||
|
|
||||||
source = GetMouseInputSource(mouse, mouseID);
|
source = GetMouseInputSource(mouse, mouseID);
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
@ -1031,14 +1030,12 @@ int
|
||||||
SDL_CaptureMouse(SDL_bool enabled)
|
SDL_CaptureMouse(SDL_bool enabled)
|
||||||
{
|
{
|
||||||
SDL_Mouse *mouse = SDL_GetMouse();
|
SDL_Mouse *mouse = SDL_GetMouse();
|
||||||
SDL_Window *focus_window;
|
|
||||||
|
|
||||||
if (!mouse->CaptureMouse) {
|
if (!mouse->CaptureMouse) {
|
||||||
return SDL_Unsupported();
|
return SDL_Unsupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
focus_window = SDL_GetKeyboardFocus();
|
if (enabled && SDL_GetKeyboardFocus() == NULL) {
|
||||||
if (enabled && !focus_window) {
|
|
||||||
return SDL_SetError("No window has focus");
|
return SDL_SetError("No window has focus");
|
||||||
}
|
}
|
||||||
mouse->capture_desired = enabled;
|
mouse->capture_desired = enabled;
|
||||||
|
|
Loading…
Reference in a new issue