diff --git a/src/hello_imgui/hello_imgui.h b/src/hello_imgui/hello_imgui.h index c079a7a9..8a920a1c 100644 --- a/src/hello_imgui/hello_imgui.h +++ b/src/hello_imgui/hello_imgui.h @@ -193,6 +193,11 @@ std::string GetBackendDescription(); // (useful if you want to change the window size during execution) void ChangeWindowSize(const ScreenSize &windowSize); + +// `ChangeWindowFullMonitorWorkArea()`: sets the window size to the monitor work area +// (useful if you want to change the window size during execution) +void ChangeWindowFullMonitorWorkArea(); + // @@md diff --git a/src/hello_imgui/impl/hello_imgui.cpp b/src/hello_imgui/impl/hello_imgui.cpp index 90831d9f..86971d75 100644 --- a/src/hello_imgui/impl/hello_imgui.cpp +++ b/src/hello_imgui/impl/hello_imgui.cpp @@ -408,6 +408,14 @@ void ChangeWindowSize(const ScreenSize &windowSize) gLastRunner->ChangeWindowSize(windowSize); } + +void ChangeWindowFullMonitorWorkArea() +{ + + gLastRunner->ChangeWindowFullMonitorWorkArea(); +} + + bool ShouldRemoteDisplay() { return gLastRunner->ShouldRemoteDisplay(); diff --git a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp index 60a0670b..0caf19c1 100644 --- a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp +++ b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp @@ -220,6 +220,13 @@ void AbstractRunner::ChangeWindowSize(HelloImGui::ScreenSize windowSize) mBackendWindowHelper->SetWindowBounds(mWindow, bounds); } +void AbstractRunner::ChangeWindowFullMonitorWorkArea() +{ + auto screenBounds = mGeometryHelper->GetCurrentMonitorWorkArea(mBackendWindowHelper.get(),mWindow); + this->setWasWindowResizedByCodeDuringThisFrame(); + mBackendWindowHelper->SetWindowBounds(mWindow, screenBounds); +} + bool AbstractRunner::ShallSizeWindowRelativeTo96Ppi() { bool shallSizeRelativeTo96Ppi; diff --git a/src/hello_imgui/internal/backend_impls/abstract_runner.h b/src/hello_imgui/internal/backend_impls/abstract_runner.h index 653eb0f4..58fc33a1 100644 --- a/src/hello_imgui/internal/backend_impls/abstract_runner.h +++ b/src/hello_imgui/internal/backend_impls/abstract_runner.h @@ -40,6 +40,7 @@ class AbstractRunner ImageBuffer ScreenshotRgb() { return mRenderingBackendCallbacks->Impl_ScreenshotRgb_3D(); } void ChangeWindowSize(ScreenSize windowSize); + void ChangeWindowFullMonitorWorkArea(); void LayoutSettings_SwitchLayout(const std::string& layoutName); bool ShouldRemoteDisplay();