Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions backends/imgui_impl_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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-04-21: Added a Win32-specific implementation of ImGui_ImplGlfw_GetContentScaleXXXX functions for legacy GLFW 3.2.
// 2026-03-25: Mouse cursor is properly restored if changed by user app/code while using glfwSetInputMode(..., GLFW_CURSOR_DISABLED) or ImGuiConfigFlags_NoMouseCursorChange. Amend change from 2025-12-10.
Expand Down Expand Up @@ -1314,15 +1315,18 @@ 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))
{
if (ImGui_ImplGlfw_ViewportData* vd = (ImGui_ImplGlfw_ViewportData*)viewport->PlatformUserData)
{
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;
Expand Down