Fix windows that shouldn't move (#1617)

* fix(overlay): don't move while menu closed
* fix(CmdExecutor): don't move by user input
This commit is contained in:
Andreas Maerten 2023-07-05 23:54:06 +02:00 committed by GitHub
parent 13d5d81cea
commit a7bcaae371
2 changed files with 7 additions and 2 deletions

View File

@ -18,7 +18,7 @@ namespace big
ImGui::SetNextWindowBgAlpha(0.65f); ImGui::SetNextWindowBgAlpha(0.65f);
ImGui::SetNextWindowSize({screen_x * 0.5f, -1}); ImGui::SetNextWindowSize({screen_x * 0.5f, -1});
if (ImGui::Begin("cmd_executor", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav)) if (ImGui::Begin("cmd_executor", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMouseInputs))
{ {
static char command_buffer[255]; static char command_buffer[255];
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {10.f, 15.f}); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {10.f, 15.f});

View File

@ -15,7 +15,12 @@ namespace big
ImGui::SetNextWindowPos(ImVec2(10.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f)); ImGui::SetNextWindowPos(ImVec2(10.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f));
ImGui::SetNextWindowBgAlpha(0.5f); ImGui::SetNextWindowBgAlpha(0.5f);
if (ImGui::Begin("overlay", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav)) auto window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
if (!g_gui->is_open())
{
window_flags |= ImGuiWindowFlags_NoMouseInputs;
}
if (ImGui::Begin("overlay", nullptr, window_flags))
{ {
ImGui::Text("YimMenu"); ImGui::Text("YimMenu");