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/ui/RunningScriptsWidget.cpp (1 of 5 files). Show all

Unified · Split

interface/src/ui/RunningScriptsWidget.cpp+1−21
@@ -151,27 +151,7 @@ void RunningScriptsWidget::showEvent(QShowEvent* event) { · 150 unmodified lines
151151 ui->filterLineEdit->setFocus();
152152 }
153153
154− QRect parentGeometry = parentWidget()->geometry();
155−
156− // If our parent window is on the HMD, then don't use it's geometry, instead use
157− // the "main screen" geometry.
158− HMDToolsDialog* hmdTools = Menu::getInstance()->getHMDToolsDialog();
159− if (hmdTools && hmdTools->hasHMDScreen()) {
160− QScreen* hmdScreen = hmdTools->getHMDScreen();
161− QWindow* appWindow = parentWidget()->windowHandle();
162− QScreen* appScreen = appWindow->screen();
163−
164− // if our app's screen is the hmd screen, we don't want to place the
165− // running scripts widget on it. So we need to pick a better screen.
166− // we will use the screen for the HMDTools since it's a guarenteed
167− // better screen.
168− if (appScreen == hmdScreen) {
169− QScreen* betterScreen = hmdTools->windowHandle()->screen();
170− parentGeometry = betterScreen->geometry();
171− }
172−
173− }
174−
154+ QRect parentGeometry = Application::getInstance()->getDesirableApplicationGeometry();
175155 int titleBarHeight = UIUtil::getWindowTitleBarHeight(this);
176156 int menuBarHeight = Menu::getInstance()->geometry().height();
177157 int topMargin = titleBarHeight + menuBarHeight;