From 3bb079216cc9848dcbed089c331d9afa0d087e71 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 24 Dec 2023 14:35:44 +0100 Subject: [PATCH] impr: Make sure welcome screen never gets detached from main window --- plugins/builtin/source/content/welcome_screen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index d05a6649c..2ac87d996 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -354,6 +354,7 @@ namespace hex::plugin::builtin { ImGui::SetNextWindowScroll({ 0.0F, -1.0F }); ImGui::SetNextWindowSize(ImGui::GetContentRegionAvail() + scaled({ 0, 10 })); ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos() - ImVec2(0, ImGui::GetStyle().FramePadding.y + 2_scaled)); + ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); if (ImGui::Begin("Welcome Screen", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove)) { ImGui::BringWindowToDisplayBack(ImGui::GetCurrentWindowRead()); if (s_simplifiedWelcomeScreen) @@ -405,6 +406,7 @@ namespace hex::plugin::builtin { ImGui::SetNextWindowScroll({ 0.0F, -1.0F }); ImGui::SetNextWindowSize(ImGui::GetContentRegionAvail() + scaled({ 0, 10 })); ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos() - ImVec2(0, ImGui::GetStyle().FramePadding.y + 2_scaled)); + ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); if (ImGui::Begin("Welcome Screen", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove)) { auto imageSize = scaled(ImVec2(350, 350)); auto imagePos = (ImGui::GetContentRegionAvail() - imageSize) / 2;