Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -37,6 +37,7 @@ · 36 unmodified lines | ||
| 37 | 37 | #include <QOpenGLFramebufferObject> |
| 38 | 38 | #include <QObject> |
| 39 | 39 | #include <QWheelEvent> |
| 40 | +#include <QScreen> | |
| 40 | 41 | #include <QSettings> |
| 41 | 42 | #include <QShortcut> |
| 42 | 43 | #include <QTimer> |
| @@ -2714,6 +2715,29 @@ bool Application::isHMDMode() const { · 2671 unmodified lines | ||
| 2714 | 2715 | } |
| 2715 | 2716 | } |
| 2716 | 2717 | |
| 2718 | +QRect Application::getDesirableApplicationGeometry() { | |
| 2719 | + QRect applicationGeometry = getWindow()->geometry(); | |
| 2720 | + | |
| 2721 | + // If our parent window is on the HMD, then don't use it's geometry, instead use | |
| 2722 | + // the "main screen" geometry. | |
| 2723 | + HMDToolsDialog* hmdTools = Menu::getInstance()->getHMDToolsDialog(); | |
| 2724 | + if (hmdTools && hmdTools->hasHMDScreen()) { | |
| 2725 | + QScreen* hmdScreen = hmdTools->getHMDScreen(); | |
| 2726 | + QWindow* appWindow = getWindow()->windowHandle(); | |
| 2727 | + QScreen* appScreen = appWindow->screen(); | |
| 2728 | + | |
| 2729 | + // if our app's screen is the hmd screen, we don't want to place the | |
| 2730 | + // running scripts widget on it. So we need to pick a better screen. | |
| 2731 | + // we will use the screen for the HMDTools since it's a guarenteed | |
| 2732 | + // better screen. | |
| 2733 | + if (appScreen == hmdScreen) { | |
| 2734 | + QScreen* betterScreen = hmdTools->windowHandle()->screen(); | |
| 2735 | + applicationGeometry = betterScreen->geometry(); | |
| 2736 | + } | |
| 2737 | + } | |
| 2738 | + return applicationGeometry; | |
| 2739 | +} | |
| 2740 | + | |
| 2717 | 2741 | ///////////////////////////////////////////////////////////////////////////////////// |
| 2718 | 2742 | // loadViewFrustum() |
| 2719 | 2743 | // |