diff --git a/backends/imgui_impl_glfw.cpp b/backends/imgui_impl_glfw.cpp index 72efc39f0..8e767ee90 100644 --- a/backends/imgui_impl_glfw.cpp +++ b/backends/imgui_impl_glfw.cpp @@ -31,6 +31,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2026-XX-XX: [Docking] Multi-viewport: treat different window position reported after glfwSetWindowPos() as an actual platform move. (#9356, #9398) // 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface. // 2026-09-15: [Docking] Fixed applying mouse cursor shapes to secondary viewports (broken in 1.92.6, 2025-12-10). // 2026-04-21: Added a Win32-specific implementation of ImGui_ImplGlfw_GetContentScaleXXXX functions for legacy GLFW 3.2. @@ -1320,7 +1321,7 @@ static void ImGui_ImplGlfw_WindowCloseCallback(GLFWwindow* window) // - on Linux it is queued and invoked during glfwPollEvents() // Because the event doesn't always fire on glfwSetWindowXXX() we use a frame counter tag to only // ignore recent glfwSetWindowXXX() calls. -static void ImGui_ImplGlfw_WindowPosCallback(GLFWwindow* window, int, int) +static void ImGui_ImplGlfw_WindowPosCallback(GLFWwindow* window, int x, int y) { if (ImGuiViewport* viewport = ImGui::FindViewportByPlatformHandle(window)) { @@ -1328,7 +1329,10 @@ static void ImGui_ImplGlfw_WindowPosCallback(GLFWwindow* window, int, int) { bool ignore_event = (ImGui::GetFrameCount() <= vd->IgnoreWindowPosEventFrame + 1); //data->IgnoreWindowPosEventFrame = -1; - if (ignore_event) + // The event may report a different position than requested when the window manager + // clamps/moves the platform window (e.g. Linux/X11 near monitor edges). In that case + // keep the viewport in sync with the real platform position instead of ignoring it. + if (ignore_event && x == (int)viewport->Pos.x && y == (int)viewport->Pos.y) return; } viewport->PlatformRequestMove = true;