mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-20 10:18:26 +00:00
Backends: SDL2, SDL3: Replace Win32 hack with SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN hint. (#7896)
This commit is contained in:
@@ -952,15 +952,9 @@ static void ImGui_ImplSDL3_ShowWindow(ImGuiViewport* viewport)
|
||||
ex_style |= WS_EX_TOOLWINDOW;
|
||||
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
|
||||
}
|
||||
|
||||
// SDL hack: SDL always activate/focus windows :/
|
||||
if (viewport->Flags & ImGuiViewportFlags_NoFocusOnAppearing)
|
||||
{
|
||||
::ShowWindow(hwnd, SW_SHOWNA);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_SetHint(SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN, (viewport->Flags & ImGuiViewportFlags_NoFocusOnAppearing) ? "0" : "1");
|
||||
SDL_ShowWindow(vd->Window);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user