pygame-ce
pygame-ce copied to clipboard
Documentation need to explain the difference between WINDOWFOCUSGAINED and WINDOWTAKEFOCUS
The short description of the two events doesn't give more information : WINDOWFOCUSGAINED Window gained focus WINDOWTAKEFOCUS Window was offered focus
And the word TAKE give "was offered" ? What does it mean ?
Following infomation may be useful:
Accroding to the comments in SDL_video.h of SDL2.30.9:
typedef enum
{
...
SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */
...
SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */
...
} SDL_WindowEventID;
Accroding to the comments in SDL_events.h of SDL3.1.6:
typedef enum SDL_EventType
{
...
SDL_EVENT_WINDOW_FOCUS_GAINED, /**< Window has gained keyboard focus */
...
} SDL_EventType;
In SDL3, WINDOW_TAKE_FOCUS is no longer exist.
Good answer ! I've read the SDL3 doc and i've see that too. Perhaps we can mark OBSOLETE/DEPRECATED the WINDOWTAKEFOCUS in the doc ?