Remove the SDL_EVENT_WINDOW_TAKE_FOCUS event

This was added by the Unreal Engine to handle the input focus for popups and dialogs, window types for which SDL3 has built-in, cross-platform support.

This was only ever implemented in X11, and the only purpose was to hint that a client application may want to call the SDL_SetWindowInputFocus() function, which has since been removed, rendering it pointless now.
This commit is contained in:
Frank Praznik
2024-07-03 11:39:59 -04:00
parent be13328cb1
commit 74cc06db1b
5 changed files with 3 additions and 15 deletions

View File

@@ -317,7 +317,6 @@ static void SDL_LogEvent(const SDL_Event *event)
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_FOCUS_GAINED);
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_FOCUS_LOST);
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_CLOSE_REQUESTED);
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_TAKE_FOCUS);
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_HIT_TEST);
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_ICCPROF_CHANGED);
SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_DISPLAY_CHANGED);

View File

@@ -1635,9 +1635,6 @@ static void SDLTest_PrintEvent(const SDL_Event *event)
case SDL_EVENT_WINDOW_CLOSE_REQUESTED:
SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " closed", event->window.windowID);
break;
case SDL_EVENT_WINDOW_TAKE_FOCUS:
SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " take focus", event->window.windowID);
break;
case SDL_EVENT_WINDOW_HIT_TEST:
SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " hit test", event->window.windowID);
break;

View File

@@ -1425,15 +1425,6 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
#endif
SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
break;
} else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) &&
(xevent->xclient.format == 32) &&
(xevent->xclient.data.l[0] == videodata->WM_TAKE_FOCUS)) {
#ifdef DEBUG_XEVENTS
printf("window %p: WM_TAKE_FOCUS\n", data);
#endif
SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_TAKE_FOCUS, 0, 0);
break;
}
} break;