diff --git a/imgui.cpp b/imgui.cpp index e05811a7..6555f6d9 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3234,13 +3234,13 @@ static void ImGui::UpdateMovingWindow() KeepAliveID(g.ActiveId); IM_ASSERT(g.MovingWindow && g.MovingWindow->RootWindow); ImGuiWindow* moving_window = g.MovingWindow->RootWindow; - if (g.IO.MouseDown[0]) + if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos)) { ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset; if (moving_window->PosFloat.x != pos.x || moving_window->PosFloat.y != pos.y) { MarkIniSettingsDirty(moving_window); - moving_window->PosFloat = pos; + SetWindowPos(moving_window, pos, ImGuiCond_Always); } FocusWindow(g.MovingWindow); }