Skip to content

Commit 1fbab15

Browse files
committed
Focus: fixed fallback "Debug" window temporarily taking focus and setting io.WantCaptureKeyboard for a frame. (#9243)
1 parent 7546f1e commit 1fbab15

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ Other Changes:
9292
- Implemented a custom tweak to extend hit-testing bounding box when window is sitting
9393
at the edge of a viewport (e.g. fullscreen or docked window), so that e.g. mouse the
9494
mouse at the extreme of the screen will reach the scrollbar. (#9276)
95+
- Focus: fixed fallback "Debug" window temporarily taking focus and setting io.WantCaptureKeyboard
96+
for one frame on e.g. application boot if no other windows are submitted. (#9243)
9597
- Demo: fixed IMGUI_DEMO_MARKER locations for examples applets. (#9261, #3689) [@pthom]
9698
- Backends:
9799
- SDLGPU3: removed unnecessary call to SDL_WaitForGPUIdle when releasing

imgui.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5985,10 +5985,14 @@ void ImGui::EndFrame()
59855985
}
59865986
g.WantTextInputNextFrame = ime_data->WantTextInput ? 1 : 0;
59875987

5988-
// Hide implicit/fallback "Debug" window if it hasn't been used
5988+
// Hide and unfocus implicit/fallback "Debug" window if it hasn't been used
59895989
g.WithinFrameScopeWithImplicitWindow = false;
5990-
if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
5990+
if (g.CurrentWindow && g.CurrentWindow->IsFallbackWindow && g.CurrentWindow->WriteAccessed == false)
5991+
{
59915992
g.CurrentWindow->Active = false;
5993+
if (g.NavWindow && g.NavWindow->RootWindow == g.CurrentWindow)
5994+
FocusWindow(NULL);
5995+
}
59925996
End();
59935997

59945998
// Update navigation: Ctrl+Tab, wrap-around requests

0 commit comments

Comments
 (0)