Skip to content

When SDL_HINT_FORCE_RAISEWINDOW is set to "1", SDL does not generate any SDL_EVENT_WINDOW_FOCUS_GAINED events. #13232

Open
@pipiwoaini

Description

@pipiwoaini

Description:
When SDL_HINT_FORCE_RAISEWINDOW is set to "1" before initializing SDL’s video subsystem and a window is created in a hidden state, calling the standard Show → Restore → Raise sequence does not trigger a focus-gained event. As a result, text input is never started: only SDL_KEYDOWN/SDL_KEYUP events arrive, but no SDL_EVENT_TEXT_INPUT, which makes any text field unusable.

Steps to Reproduce:
1. Set SDL_HINT_FORCE_RAISEWINDOW = "1" before calling SDL_InitSubSystem.
2. Create a window with the hidden flag.
3. Show, restore, and raise the window.
4. Attach an input widget that listens for SDL_EVENT_WINDOW_FOCUS_GAINED and SDL_EVENT_TEXT_INPUT.

Actual Behavior:
• No SDL_EVENT_WINDOW_FOCUS_GAINED is emitted.
• Only key-down and key-up events are delivered.
• SDL_EVENT_TEXT_INPUT never fires, so text cannot be entered.

Expected Behavior:
• Raising the window should generate a SDL_EVENT_WINDOW_FOCUS_GAINED.
• SDL should begin text input, emitting SDL_EVENT_TEXT_INPUT for character input.

Impact:
Without the focus-gained event, text fields never receive character data, blocking all keyboard text entry in applications that rely on SDL’s text-input events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions