PR comments

This commit is contained in:
Brad Davis 2016-01-11 12:49:53 -08:00
parent d28f80aa07
commit d1d178787c
4 changed files with 28 additions and 3 deletions

View file

@ -3449,6 +3449,29 @@ bool Application::isHMDMode() const {
}
float Application::getTargetFrameRate() { return getActiveDisplayPlugin()->getTargetFrameRate(); }
QRect Application::getDesirableApplicationGeometry() {
QRect applicationGeometry = getWindow()->geometry();
// If our parent window is on the HMD, then don't use its geometry, instead use
// the "main screen" geometry.
HMDToolsDialog* hmdTools = DependencyManager::get<DialogsManager>()->getHMDToolsDialog();
if (hmdTools && hmdTools->hasHMDScreen()) {
QScreen* hmdScreen = hmdTools->getHMDScreen();
QWindow* appWindow = getWindow()->windowHandle();
QScreen* appScreen = appWindow->screen();
// if our app's screen is the hmd screen, we don't want to place the
// running scripts widget on it. So we need to pick a better screen.
// we will use the screen for the HMDTools since it's a guarenteed
// better screen.
if (appScreen == hmdScreen) {
QScreen* betterScreen = hmdTools->windowHandle()->screen();
applicationGeometry = betterScreen->geometry();
}
}
return applicationGeometry;
}
/////////////////////////////////////////////////////////////////////////////////////
// loadViewFrustum()
//

View file

@ -205,6 +205,7 @@ public:
glm::mat4 getEyeOffset(int eye) const;
glm::mat4 getEyeProjection(int eye) const;
QRect getDesirableApplicationGeometry();
Bookmarks* getBookmarks() const { return _bookmarks; }
virtual bool canAcceptURL(const QString& url) const override;
@ -466,7 +467,7 @@ private:
TouchEvent _lastTouchEvent;
RunningScriptsWidget* _runningScriptsWidget{ nullptr };
RunningScriptsWidget* _runningScriptsWidget { nullptr };
quint64 _lastNackTime;
quint64 _lastSendDownstreamAudioStats;

View file

@ -172,7 +172,7 @@ void RunningScriptsWidget::showEvent(QShowEvent* event) {
ui->filterLineEdit->setFocus();
}
QRect parentGeometry = qApp->getWindow()->geometry();
QRect parentGeometry = qApp->getDesirableApplicationGeometry();
int titleBarHeight = UIUtil::getWindowTitleBarHeight(this);
int topMargin = titleBarHeight;

View file

@ -35,7 +35,8 @@ ScriptsModel& getScriptsModel() {
ScriptEngines::ScriptEngines()
: _scriptsLocationHandle("scriptsLocation", DESKTOP_LOCATION),
_previousScriptLocation("LastScriptLocation", DESKTOP_LOCATION){
_previousScriptLocation("LastScriptLocation", DESKTOP_LOCATION)
{
_scriptsModelFilter.setSourceModel(&_scriptsModel);
_scriptsModelFilter.sort(0, Qt::AscendingOrder);
_scriptsModelFilter.setDynamicSortFilter(true);