Allow to finely choose on which display to output

This commit is contained in:
baydam
2016-04-22 17:00:55 +00:00
parent d8d9671b6c
commit d01dd4d356
4 changed files with 93 additions and 24 deletions

View File

@@ -40,6 +40,7 @@ OutputGLWindow:: OutputGLWindow(QWidget* parent, const MapperGLCanvas* canvas_)
setDisplayCrosshair(false); // default
this->_is_fullscreen = false;
_preferredScreen = QApplication::screens().size() - 1;
}
//OutputGLWindow::OutputGLWindow(MainWindow* mainWindow, QWidget* parent, const QGLWidget * shareWidget) : QDialog(parent)
@@ -83,17 +84,10 @@ void OutputGLWindow::setFullScreen(bool fullscreen)
this->_is_fullscreen = fullscreen;
}
void OutputGLWindow::updateScreenCount(int nScreens)
{
Q_UNUSED(nScreens);
// Untested.
_updateToPreferredScreen();
}
void OutputGLWindow::_updateToPreferredScreen()
{
// Check if user is on multiple screen (always pre
int screen = _getPreferredScreen();
int screen = _preferredScreen;
//Move window to second screen before fullscreening it.
setGeometry(QApplication::desktop()->screenGeometry(screen));
}
@@ -111,5 +105,13 @@ void OutputGLWindow::setDisplayTestSignal(bool displayTestSignal)
canvas->update();
}
void OutputGLWindow::setPreferredScreen(int screen)
{
if (screen < QApplication::screens().size())
_preferredScreen = screen;
else
_preferredScreen = QApplication::screens().size() - 1;
}
MM_END_NAMESPACE