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
37#include <QOpenGLFramebufferObject>37#include <QOpenGLFramebufferObject>
38#include <QObject>38#include <QObject>
39#include <QWheelEvent>39#include <QWheelEvent>
40#include <QScreen>
40#include <QSettings>41#include <QSettings>
41#include <QShortcut>42#include <QShortcut>
42#include <QTimer>43#include <QTimer>
@@ -2714,6 +2715,29 @@ bool Application::isHMDMode() const { · 2671 unmodified lines
2714 }2715 }
2715}2716}
2716 2717
2718QRect 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// loadViewFrustum()2742// loadViewFrustum()
2719//2743//

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