-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to disable resizing via imgui and hide grips on secondary viewports? #4534
Comments
Im embarassed because i found the solution jsut after writing this question :) sorry :) here my solution : static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse; // by ex
if (ImGui::Begin(windows_name, &opened, flags ))
{
auto win = ImGui::GetCurrentWindowRead();
// test is the window is in another viewport than the default
// and so disable titlebar and resizing (the grip will be hidden, and the resizing feature via imgui will be disabled)
if (win->Viewport->Idx != 0)
flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar;
else
flags = ImGuiWindowFlags_NoCollapse; //return to default, when merged in main viewport and not forgot to disable decoration with that code : io.ConfigViewportsNoDecoration = false; the result : it working like a charm but could be better to have a option for that in imgui, like that can be applied for every child windows |
Decorations are off on popups and transient windows such as tooltips. ImGuiWindowClass window_class;
window_class.ViewportFlagsOverrideClear = ImGuiViewportFlags_NoDecoration;
ImGui::SetNextWindowClass(&window_class); The viewport configuration flags are a little bit of a mess, will refactor at some point.
It sucks but I think if you are affected by this issue you should consider using DX11 on Windows. |
Ok thank for the trick :) If the bug is on GLFW / SDL side, not sure if Directx will not have the issue. ? By the way my app is a cross platform Opengl Shader editor, so i cant use directx, or use directx for app and opengl for rendering but not sure after to display GL texture on a Directx ui. too much complex if possible i guess. By the way the decoration is interesting too, for have split feature (magnetic splitting way) of windows on screen, like we have on win and linux. (i guess also on macos) so for the moment, its the best trick i found. |
Hello,
Version/Branch of Dear ImGui:
Version: 1.84.2
Branch: docking / viewport
Back-end/Renderer/Compiler/OS
Back-ends: glfw and opengl3
Compiler: msvc
Operating System: win10 64
My Issue/Question:
I have always the crash same issue (#3321) when i try to resize a chid windows
I tested in GLFW3 and SDL2 and i have the same issues.
There is many similar report for this issue in the forums of GLFW3 and SDL2.
So its not the fault of ImGui
I can avoid this crash by using the window resizing (if the decoration is enabled) instead of via imgui
But If i disable the decorations with that line
io.ConfigViewportsNoDecoration = false;
I always have the grip who is displayed on child windows.
The crash happen via this grip, but not via the windows.
because when i resize via the windows borders, the fbo is re created after the end of the resizing,
afaik i not see any crash issue.
if i resize with the grip, the fbo is constantly recreated during the resizing and the crash happen.
so i would like to disable the grip and the resizing feature (via grip or edges) of imgui for the child windows. (not for internal windows of a child windows, just for the child windows himself)
Is there a easy way for doing that without breaking ImGui ?
The text was updated successfully, but these errors were encountered: