Skip to content
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

Documentation need to explain the difference between WINDOWFOCUSGAINED and WINDOWTAKEFOCUS #3253

Open
mentat51 opened this issue Dec 5, 2024 · 2 comments
Labels
docs event pygame.event

Comments

@mentat51
Copy link

mentat51 commented Dec 5, 2024

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 ?

@mentat51 mentat51 changed the title Documentation need to describe the difference between WINDOWFOCUSGAINED and WINDOWTAKEFOCUS Documentation need to explain the difference between WINDOWFOCUSGAINED and WINDOWTAKEFOCUS Dec 5, 2024
@yunline
Copy link
Contributor

yunline commented Dec 9, 2024

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.

@yunline yunline added docs event pygame.event labels Dec 9, 2024
@mentat51
Copy link
Author

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs event pygame.event
Projects
None yet
Development

No branches or pull requests

2 participants