New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigWindowsMoveFromTitleBarOnly flag prevents dragging windows across vertically arranged displays. #7299
Comments
Just in case, can you report the coordinates of all monitors as reported in Metrics->Viewport? |
I currently don't have multiple monitors to test with, but I guess this is causing the issue: else if (window->ViewportOwned && g.PlatformIO.Monitors.Size > 0)
{
// Lost windows (e.g. a monitor disconnected) will naturally moved to the fallback/dummy monitor aka the main viewport.
const ImGuiPlatformMonitor* monitor = GetViewportPlatformMonitor(window->Viewport);
visibility_rect.Min = monitor->WorkPos + visibility_padding;
visibility_rect.Max = monitor->WorkPos + monitor->WorkSize - visibility_padding;
ClampWindowPos(window, visibility_rect);
} static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_rect)
{
ImGuiContext& g = *GImGui;
ImVec2 size_for_clamping = window->Size;
if (g.IO.ConfigWindowsMoveFromTitleBarOnly && (!(window->Flags & ImGuiWindowFlags_NoTitleBar) || window->DockNodeAsHost))
size_for_clamping.y = ImGui::GetFrameHeight(); // Not using window->TitleBarHeight() as DockNodeAsHost will report 0.0f here.
window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max);
} Our way of clamping position use monitor boundaries. Problem is that we can have rectangular boundaries encompassing all monitors area, so we may need to do thing differently while moving a window vs when not moving it. |
Actually same as #3071 |
I'll follow the other ticket. (missed it) |
Should be fixed with 30ba3c3 ! |
Version/Branch of Dear ImGui:
Version 1.90
Back-ends:
imgui_impl_dx11.cpp
Compiler, OS:
Windows 11 + MSVC 2017
Full config/build information:
Details:
When I have a displays arranged vertically (one above another), I am unable to drag windows from a lower display to a higher display.
I have found that this is due to the following line:
io.ConfigWindowsMoveFromTitleBarOnly = true;
And when I set that to false it works again.
(Also, when it is
true
, dragging a window down into a lower display works well until the window is about halfway into the lower display, when it suddenly jumps the entire window onto the lower display)I also notice that toggling:
ConfigViewportsNoDecoration
tofalse
(showing windows default decoration) fixes it.Screenshots/Video:
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: