History

dry up code and make chat window avoid the hmd screen

ZappoMan committed 11 years ago

Commit ec54b601 parent 06d348c5 files · +30 −44Browse files

Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all

Unified · Split

interface/src/Application.cpp+24−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <QOpenGLFramebufferObject>
3838 #include <QObject>
3939 #include <QWheelEvent>
40+#include <QScreen>
4041 #include <QSettings>
4142 #include <QShortcut>
4243 #include <QTimer>
@@ -2714,6 +2715,29 @@ bool Application::isHMDMode() const { · 2671 unmodified lines
27142715 }
27152716 }
27162717
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+
27172741 /////////////////////////////////////////////////////////////////////////////////////
27182742 // loadViewFrustum()
27192743 //

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t