You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the primary viewport gets maximized and then restored (aka, turned back into a non-maximized window), all other windows that were inside the primary viewport when it was maximized, but do not fit into it when not maximized, are moved towards the right. This shift becomes larger if the primary viewport has been moved to the right before maximizing it (effectively, the other windows are moved by the delta between the maximized viewport position and non-maximized viewport position of the maximized viewport). See the attached video for a visual demonstration (it's much easier to show than to explain in words).
The problem is much more noticable on my 1440p ultra-wide monitor than on my 1080p 16:9 monitor, but it can be observed on both.
In the worst case (when moving the primary window to the right edge of the screen before maximizing it), this can cause the other windows to move almost completely off screen. There seems to be some safe-guard that ensures to have at least a small edge of the window always stays on screen, so they aren't completely lost, but especially on a ultra-wide monitor this small edge can be easily overlooked, even more so as one would expect the window position to stay where it was.
My expectation is, that all non-docked windows stay at the same position on screen when I maximize or restore the primary viewport (or, at the very least, don't move off screen), as this is also the behaviour when I resize the primary viewport to become smaller.
I could track down, that this is caused by the logic in ImGui::TranslateWindowsInViewport. If I simply remove the check in this function related to test_still_fit_rect (so the if condition becomes if (translate_all_windows || (window->Viewport == viewport && old_size == new_size))), it fixes the maximize/restore issue while maintaining correct behaviour when moving or resizing the window manually - though I don't know if I might be overlooking some edge case that required this test_still_fit_rect check (I'm obviously not very familiar with the inner workings of the ImGui code and just quickly tried some simple test cases).
Screenshots/Video:
2026-04-28.22-50-14.mp4
Minimal, Complete and Verifiable Example code:
Just run the Win32 (DirectX 12) example, move the primary window, then maximize and restore repeatedly. No code modification needed.
Version/Branch of Dear ImGui:
Version 1.92.8 WIP, Branch:docking
Back-ends:
imgui_impl_dx12.cpp + imgui_impl_win32.cpp
Compiler, OS:
Windows 11 + MSVC 2026
Full config/build information:
// (Copy from the next line. Keep the ``` markers for formatting.)
Details:
My Issue:
When the primary viewport gets maximized and then restored (aka, turned back into a non-maximized window), all other windows that were inside the primary viewport when it was maximized, but do not fit into it when not maximized, are moved towards the right. This shift becomes larger if the primary viewport has been moved to the right before maximizing it (effectively, the other windows are moved by the delta between the maximized viewport position and non-maximized viewport position of the maximized viewport). See the attached video for a visual demonstration (it's much easier to show than to explain in words).
The problem is much more noticable on my 1440p ultra-wide monitor than on my 1080p 16:9 monitor, but it can be observed on both.
In the worst case (when moving the primary window to the right edge of the screen before maximizing it), this can cause the other windows to move almost completely off screen. There seems to be some safe-guard that ensures to have at least a small edge of the window always stays on screen, so they aren't completely lost, but especially on a ultra-wide monitor this small edge can be easily overlooked, even more so as one would expect the window position to stay where it was.
My expectation is, that all non-docked windows stay at the same position on screen when I maximize or restore the primary viewport (or, at the very least, don't move off screen), as this is also the behaviour when I resize the primary viewport to become smaller.
I could track down, that this is caused by the logic in
ImGui::TranslateWindowsInViewport. If I simply remove the check in this function related totest_still_fit_rect(so the if condition becomesif (translate_all_windows || (window->Viewport == viewport && old_size == new_size))), it fixes the maximize/restore issue while maintaining correct behaviour when moving or resizing the window manually - though I don't know if I might be overlooking some edge case that required thistest_still_fit_rectcheck (I'm obviously not very familiar with the inner workings of the ImGui code and just quickly tried some simple test cases).Screenshots/Video:
2026-04-28.22-50-14.mp4
Minimal, Complete and Verifiable Example code:
Just run the Win32 (DirectX 12) example, move the primary window, then maximize and restore repeatedly. No code modification needed.