mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-13 23:08:23 +00:00
Inputs, Viewports: fix UpdateViewportsNewFrame() running before UpdateInputEvents(), leading to MouseViewport lagging by a frame on transitions. (#5837, #4921)
Will merge the swap in master.
This commit is contained in:
@@ -4666,6 +4666,11 @@ void ImGui::NewFrame()
|
||||
g.FramerateSecPerFrameCount = ImMin(g.FramerateSecPerFrameCount + 1, IM_ARRAYSIZE(g.FramerateSecPerFrame));
|
||||
g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)g.FramerateSecPerFrameCount)) : FLT_MAX;
|
||||
|
||||
// Process input queue (trickle as many events as possible), turn events into writes to IO structure
|
||||
g.InputEventsTrail.resize(0);
|
||||
UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue);
|
||||
|
||||
// Update viewports (after processing input queue, so io.MouseHoveredViewport is set)
|
||||
UpdateViewportsNewFrame();
|
||||
|
||||
// Setup current font and draw list shared data
|
||||
@@ -4788,10 +4793,6 @@ void ImGui::NewFrame()
|
||||
//if (g.IO.AppFocusLost)
|
||||
// ClosePopupsExceptModals();
|
||||
|
||||
// Process input queue (trickle as many events as possible)
|
||||
g.InputEventsTrail.resize(0);
|
||||
UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue);
|
||||
|
||||
// Update keyboard input state
|
||||
UpdateKeyboardInputs();
|
||||
|
||||
|
Reference in New Issue
Block a user