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
I noticed that my window, which is constrained to the main viewport, created in a Multi-viewport environment "moves" (stays in place) when I move the main viewport window. It only does this if the window is partially outside of the main viewport. I did this constraining using a hack I found on here by setting the next window viewport (see the code example).
I'm not sure if this is the best way to go about it and I'm also happy to accept a solution that constrains the window to the main viewport and doesnt let it go outside in the first place as that would actually be the preferred behaviour.
Thanks in advance! Let me know if anything is unclear :)
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); // Disable this widget from popping out
ImGuiWindowFlags window_flags =
ImGuiWindowFlags_NoCollapse
| ImGuiWindowFlags_NoBringToFrontOnFocus
| ImGuiWindowFlags_NoDocking;
ImGui::Begin((std::string(ICON_FA_GRIP_LINES) + " Layer Stack").c_str(), nullptr, window_flags);
// Left out for brevityImGui::End();
The text was updated successfully, but these errors were encountered:
ocornut
changed the title
[Multi-viewport] Window moves if it goes outside of viewport
Multi-viewport: window constrained to main viewport moves if it goes outside of viewport
Sep 16, 2024
Version/Branch of Dear ImGui:
Version 1.90.5, Branch: docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp
Compiler, OS:
Windows 10 + MSVC 2022
Full config/build information:
No response
Details:
My Issue/Question:
I noticed that my window, which is constrained to the main viewport, created in a Multi-viewport environment "moves" (stays in place) when I move the main viewport window. It only does this if the window is partially outside of the main viewport. I did this constraining using a hack I found on here by setting the next window viewport (see the code example).
I'm not sure if this is the best way to go about it and I'm also happy to accept a solution that constrains the window to the main viewport and doesnt let it go outside in the first place as that would actually be the preferred behaviour.
Thanks in advance! Let me know if anything is unclear :)
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: