From 27fc582b593776f552b55947cda66baa4b006a38 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 5 Apr 2022 15:11:49 -0700 Subject: [PATCH] Minor cleanup --- src/events/SDL_mouse.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index f95c5b71c..735991f75 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -561,7 +561,6 @@ SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state Uint32 type; Uint32 buttonstate; SDL_MouseInputSource *source; - SDL_bool had_buttons_pressed = (SDL_GetMouseState(NULL, NULL) ? SDL_TRUE : SDL_FALSE); source = GetMouseInputSource(mouse, mouseID); if (!source) { @@ -1031,14 +1030,12 @@ int SDL_CaptureMouse(SDL_bool enabled) { SDL_Mouse *mouse = SDL_GetMouse(); - SDL_Window *focus_window; if (!mouse->CaptureMouse) { return SDL_Unsupported(); } - focus_window = SDL_GetKeyboardFocus(); - if (enabled && !focus_window) { + if (enabled && SDL_GetKeyboardFocus() == NULL) { return SDL_SetError("No window has focus"); } mouse->capture_desired = enabled;