Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
authorSam Lantinga <slouken@libsdl.org>
Thu, 29 Sep 2016 14:48:33 -0700
changeset 1037984be6396b68b
parent 10378 cb7f88c92a2e
child 10380 59efdcdd99e5
Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
src/video/windows/SDL_windowsevents.c
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Thu Sep 29 13:34:49 2016 -0700
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Thu Sep 29 14:48:33 2016 -0700
     1.3 @@ -198,6 +198,12 @@
     1.4      return code;
     1.5  }
     1.6  
     1.7 +static SDL_bool
     1.8 +WIN_ShouldIgnoreFocusClick()
     1.9 +{
    1.10 +    const char *hint = "1";//SDL_GetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH);
    1.11 +    return (!hint || (*hint == '0')) ? SDL_TRUE : SDL_FALSE;
    1.12 +}
    1.13  
    1.14  void
    1.15  WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID)
    1.16 @@ -210,7 +216,9 @@
    1.17                  WIN_UpdateClipCursor(data->window);
    1.18              }
    1.19          }
    1.20 -        return;
    1.21 +        if (WIN_ShouldIgnoreFocusClick()) {
    1.22 +            return;
    1.23 +        }
    1.24      }
    1.25  
    1.26      if (bwParamMousePressed && !bSDLMousePressed) {