Skip to content

Commit

Permalink
Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 29, 2016
1 parent a13da2f commit d285af2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/video/windows/SDL_windowsevents.c
Expand Up @@ -198,6 +198,12 @@ WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam)
return code;
}

static SDL_bool
WIN_ShouldIgnoreFocusClick()
{
const char *hint = "1";//SDL_GetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH);
return (!hint || (*hint == '0')) ? SDL_TRUE : SDL_FALSE;
}

void
WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID)
Expand All @@ -210,7 +216,9 @@ WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePress
WIN_UpdateClipCursor(data->window);
}
}
return;
if (WIN_ShouldIgnoreFocusClick()) {
return;
}
}

if (bwParamMousePressed && !bSDLMousePressed) {
Expand Down

0 comments on commit d285af2

Please sign in to comment.