|
@@ -13413,6 +13413,9 @@ static ImVec2 ImGui::NavCalcPreferredRefPos()
|
|
|
|
|
|
const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID;
|
|
|
|
|
|
+ if (source != ImGuiInputSource_Mouse && !activated_shortcut && window == NULL)
|
|
|
+ source = ImGuiInputSource_Mouse;
|
|
|
+
|
|
|
// Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag.
|
|
|
if (source == ImGuiInputSource_Mouse)
|
|
|
{
|
|
@@ -13432,7 +13435,7 @@ static ImVec2 ImGui::NavCalcPreferredRefPos()
|
|
|
ref_rect = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]);
|
|
|
|
|
|
// Take account of upcoming scrolling (maybe set mouse pos should be done in EndFrame?)
|
|
|
- if (window->LastFrameActive != g.FrameCount && (window->ScrollTarget.x != FLT_MAX || window->ScrollTarget.y != FLT_MAX))
|
|
|
+ if (window != NULL && window->LastFrameActive != g.FrameCount && (window->ScrollTarget.x != FLT_MAX || window->ScrollTarget.y != FLT_MAX))
|
|
|
{
|
|
|
ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
|
|
|
ref_rect.Translate(window->Scroll - next_scroll);
|