Skip to content

Commit

Permalink
Don't hide popups when losing focus
Browse files Browse the repository at this point in the history
This isn't the behavior on Windows, and this should probably be an application defined behavior.

If we decide we want this globally, it should probably be implemented at a higher level in SDL_OnWindowFocusLost(), and properly handle the transition of focus to a child window.
  • Loading branch information
slouken committed Mar 16, 2023
1 parent 5da9e99 commit 0cb7c4b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -461,20 +461,6 @@ static void X11_ShowChildren(_THIS, SDL_Window *window)
}
}

static void X11_HideChildren(_THIS, SDL_Window *window)
{
for (window = window->first_child; window != NULL; window = window->next_sibling) {
if (!(window->flags & SDL_WINDOW_HIDDEN)) {
window->driverdata->hidden_by_parent_focus = SDL_TRUE;
X11_HideWindow(_this, window);
}

if (window->first_child) {
X11_HideChildren(_this, window);
}
}
}

static void X11_DispatchFocusIn(_THIS, SDL_WindowData *data)
{
#ifdef DEBUG_XEVENTS
Expand Down Expand Up @@ -518,9 +504,6 @@ static void X11_DispatchFocusOut(_THIS, SDL_WindowData *data)
#ifdef SDL_USE_IME
SDL_IME_SetFocus(SDL_FALSE);
#endif
if (data->window->parent == NULL) {
X11_HideChildren(_this, data->window);
}
}

static void X11_DispatchMapNotify(SDL_WindowData *data)
Expand Down

0 comments on commit 0cb7c4b

Please sign in to comment.