diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp index 5e16fa9314..733dc087b6 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp @@ -68,6 +68,19 @@ namespace { return false; } + bool hasMultipleGuiWindows(const sgct::config::Cluster& cluster) { + bool foundGui = false; + for (const sgct::config::Window& window : cluster.nodes.front().windows) { + if (window.draw2D) { + if (foundGui) { + return true; + } + foundGui = true; + } + } + return false; + } + std::vector createMonitorInfoSet() { std::vector monitorSizes; for (QScreen* screen : qApp->screens()) { @@ -317,6 +330,21 @@ void SgctEdit::saveCluster() { } } + if (hasMultipleGuiWindows(_cluster)) { + const int ret = QMessageBox::warning( + this, + "Multiple Windows with GUI Rendering", + "Multiple windows have 2D/GUI rendering enabled. Note that the interactable " + "user interface will only be shows on the first window with such a setting " + "if you proceed. Dashboards and other 2D elements will be shown on all " + "windows.\n\nAre you sure you want to continue?", + QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No) + ); + if (ret == QMessageBox::No) { + return; + } + } + if (_configurationFilename.empty()) { const QString fileName = QFileDialog::getSaveFileName( this, diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 3d8187cdd5..37a9673a1e 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 3d8187cdd519ed83af9c810b488e6ec2bbf1eff2 +Subproject commit 37a9673a1e12494d71e8d20117060d392402d1af diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index b9db56db6d..f8dce43265 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -747,6 +747,16 @@ void setSgctDelegateFunctions() { return currentWindow->isWindowResized(); }; + sgctDelegate.anyWindowHasResized = []() { + ZoneScoped; + + for (const std::unique_ptr& window : Engine::instance().windows()) { + if (window->isWindowResized()) { + return true; + } + } + return false; + }; sgctDelegate.averageDeltaTime = []() { ZoneScoped; diff --git a/include/openspace/engine/windowdelegate.h b/include/openspace/engine/windowdelegate.h index 806adc063b..8a9cd1bf65 100644 --- a/include/openspace/engine/windowdelegate.h +++ b/include/openspace/engine/windowdelegate.h @@ -43,6 +43,7 @@ struct WindowDelegate { void (*setSynchronization)(bool enabled) = [](bool) {}; bool (*windowHasResized)() = []() { return false; }; + bool (*anyWindowHasResized)() = []() { return false; }; double (*averageDeltaTime)() = []() { return 0.0; }; diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 89f90478ce..b92f384a3c 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -228,7 +228,7 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) }); global::callback::postDraw->emplace_back([this]() { - bool windowChanged = global::windowDelegate->windowHasResized(); + bool windowChanged = global::windowDelegate->anyWindowHasResized(); if (_instance && (windowChanged || _instance->_shouldReshape)) { const glm::ivec2 res = global::windowDelegate->guiWindowResolution(); _instance->reshape(static_cast(