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'm trying to implement the maximize <-> restore functionality, i.e. by clicking on a button I want the selected window to cover the complete viewport, and by clicking once again return it to a previous position. Here's the full source code for this:
staticbool maximized{false};
// don't show if other window is maximizedif (!maximized) {
ImGui::Begin("C", nullptr);
ImGui::Text("CCCCCCCCCC");
ImGui::End();
}
ImGuiWindowFlags flags = ImGuiWindowFlags_None;
if (maximized) {
auto* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->WorkPos);
ImGui::SetNextWindowSize(viewport->WorkSize);
ImGui::SetNextWindowViewport(viewport->ID);
flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove;
}
ImGui::Begin("D", nullptr, flags);
static std::vector<char> settings{};
if (ImGui::Button(!maximized ? "Maximize" : "Restore")) {
if (!maximized) {
size_t size{};
auto s = ImGui::SaveIniSettingsToMemory(&size);
settings.resize(size);
memcpy(settings.data(), s, size);
} elseif (!settings.empty()) {
ImGui::LoadIniSettingsFromMemory(settings.data());
settings.clear();
}
maximized = !maximized;
}
ImGui::End();
The first problem with this is that the order of windows is not preserved if the windows are tabbed. I.e. before the maximizing the tabs are in CD order and after restoring it's DC.
The second problem is that with certain actions the application SOMETIMES crashes. I saw multiple different asserts, but one that is reproducible is the following:
Dock a window to the right of another window.
Maximize.
Restore.
Dock a window over the another window.
Maximize
Restore -> Crash.
The text was updated successfully, but these errors were encountered:
Version/Branch of Dear ImGui:
Version 1.90.5, Branch: docking
Back-ends:
Custom
Compiler, OS:
Ubuntu 20.04
Details:
I'm trying to implement the
maximize <-> restore
functionality, i.e. by clicking on a button I want the selected window to cover the complete viewport, and by clicking once again return it to a previous position. Here's the full source code for this:The first problem with this is that the order of windows is not preserved if the windows are tabbed. I.e. before the maximizing the tabs are in
CD
order and after restoring it'sDC
.The second problem is that with certain actions the application SOMETIMES crashes. I saw multiple different asserts, but one that is reproducible is the following:
The text was updated successfully, but these errors were encountered: