mirror of
https://github.com/stenzek/duckstation.git
synced 2024-11-26 23:50:31 +00:00
ImGuiFullscreen: Fix position resetting to top of list on popup close
This commit is contained in:
parent
5cfb76e3f5
commit
854319441c
@ -639,8 +639,6 @@ bool ImGuiFullscreen::ResetFocusHere()
|
||||
if (ImGui::FindBlockingModal(window))
|
||||
return false;
|
||||
|
||||
s_focus_reset_queued = FocusResetType::None;
|
||||
|
||||
// Set the flag that we drew an active/hovered item active for a frame, because otherwise there's one frame where
|
||||
// there'll be no frame drawn, which will cancel the animation. Also set the appearing flag, so that the default
|
||||
// focus set does actually go through.
|
||||
@ -651,8 +649,13 @@ bool ImGuiFullscreen::ResetFocusHere()
|
||||
}
|
||||
|
||||
ImGui::SetWindowFocus();
|
||||
|
||||
// If this is a popup closing, we don't want to reset the current nav item, since we were presumably opened by one.
|
||||
if (s_focus_reset_queued != FocusResetType::PopupClosed)
|
||||
ImGui::NavInitWindow(window, true);
|
||||
|
||||
s_focus_reset_queued = FocusResetType::None;
|
||||
|
||||
// only do the active selection magic when we're using keyboard/gamepad
|
||||
return (GImGui->NavInputSource == ImGuiInputSource_Keyboard || GImGui->NavInputSource == ImGuiInputSource_Gamepad);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user