Skip to content

SDL2/SDL_CreateWindow: note about mouse focus and event #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions SDL2/SDL_CreateWindow.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ On non-Apple devices, SDL requires you to either not link to the Vulkan
loader or link to a dynamic library version. This limitation may be removed
in a future version of SDL.

Additionally, a newly created window might not have mouse focus (but keyboard
focus only). By default, SDL will ignore mouse clicks that activate a window,
for its events queue thus a click in a newly created / out of focus window will
not create an event.
Use `SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");` to override this and
to receive an event from [SDL_PollEvent](SDL_PollEvent)() in such case.

## Version

This function is available since SDL 2.0.0.
Expand Down