diff --git a/src/olympic/studio/applib/src/studioapp.cpp b/src/olympic/studio/applib/src/studioapp.cpp index a9358b33..67e2bb28 100644 --- a/src/olympic/studio/applib/src/studioapp.cpp +++ b/src/olympic/studio/applib/src/studioapp.cpp @@ -102,15 +102,16 @@ void StudioUI::handleKeyEvent(turbine::Key const key, bool const down) noexcept void StudioUI::draw() noexcept { glutils::clearScreen(); drawMenu(); - auto const viewport = ImGui::GetMainViewport(); - constexpr auto menuHeight = 18; - ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x, viewport->Pos.y + menuHeight)); - ImGui::SetNextWindowSize(ImVec2(viewport->Size.x, viewport->Size.y - menuHeight)); - constexpr auto windowFlags = ImGuiWindowFlags_NoTitleBar - | ImGuiWindowFlags_NoResize - | ImGuiWindowFlags_NoMove - | ImGuiWindowFlags_NoScrollbar - | ImGuiWindowFlags_NoSavedSettings; + auto const&viewport = *ImGui::GetMainViewport(); + ImGui::SetNextWindowPos(viewport.WorkPos); + ImGui::SetNextWindowSize(viewport.WorkSize); + ImGui::SetNextWindowViewport(viewport.ID); + auto constexpr windowFlags = + ImGuiWindowFlags_NoTitleBar | + ImGuiWindowFlags_NoResize | + ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_NoScrollbar | + ImGuiWindowFlags_NoSavedSettings; ImGui::Begin("MainWindow##Studio", nullptr, windowFlags); { if (m_showProjectExplorer) { @@ -118,10 +119,10 @@ void StudioUI::draw() noexcept { ImGui::SameLine(); } drawTabBar(); - for (auto &w: m_widgets) { + for (auto const&w : m_widgets) { w->draw(m_sctx); } - for (auto const p: m_popups) { + for (auto const p : m_popups) { p->draw(m_sctx); } }