mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-04-01 13:09:36 +02:00
Fixed: It should be possible to have an output window when using a single screen (closes #209).
This commit is contained in:
@@ -1625,7 +1625,6 @@ void MainWindow::createActions()
|
||||
outputFullScreenAction->setCheckable(true);
|
||||
// Don't be displayed by default
|
||||
outputFullScreenAction->setChecked(false);
|
||||
outputFullScreenAction->setEnabled(QApplication::desktop()->screenCount() > 1);
|
||||
outputFullScreenAction->setShortcutContext(Qt::ApplicationShortcut);
|
||||
addAction(outputFullScreenAction);
|
||||
// Manage fullscreen/modal show of GL output window.
|
||||
@@ -2910,10 +2909,12 @@ void MainWindow::pollOscInterface()
|
||||
|
||||
void MainWindow::updateOutputAction(int screen)
|
||||
{
|
||||
if (screen > 1)
|
||||
outputFullScreenAction->setEnabled(true);
|
||||
else
|
||||
outputFullScreenAction->setEnabled(false);
|
||||
// Change window (untested).
|
||||
if (outputWindow->isFullScreen())
|
||||
{
|
||||
outputWindow->setFullScreen(false);
|
||||
outputWindow->setFullScreen(true);
|
||||
}
|
||||
}
|
||||
|
||||
// void MainWindow::applyOscCommand(const QVariantList& command)
|
||||
|
||||
@@ -89,44 +89,32 @@ void OutputGLWindow::setFullScreen(bool fullscreen)
|
||||
if (fullscreen)
|
||||
{
|
||||
// Check if user is on multiple screen
|
||||
if (QApplication::desktop()->screenCount() > 1)
|
||||
{
|
||||
// Hide cursor
|
||||
setCursorVisible(!fullscreen);
|
||||
// Activate crosshair in fullscreen mode.
|
||||
// should be only drawn if the controls should be shown
|
||||
canvas->setDisplayCrosshair(fullscreen && canvas->getMainWindow()->displayControls());
|
||||
//Move window to second screen before fullscreening it.
|
||||
setGeometry(QApplication::desktop()->screenGeometry(1));
|
||||
//The problem related to the full screen on linux seems to be resolved
|
||||
// with Qt 5.5 at least on Debian but define macro anyway
|
||||
int screen = (QApplication::desktop()->screenCount() > 1 ? 1 : 0);
|
||||
// Hide cursor
|
||||
setCursorVisible(!fullscreen);
|
||||
// Activate crosshair in fullscreen mode.
|
||||
// should be only drawn if the controls should be shown
|
||||
canvas->setDisplayCrosshair(fullscreen && canvas->getMainWindow()->displayControls());
|
||||
//Move window to second screen before fullscreening it.
|
||||
setGeometry(QApplication::desktop()->screenGeometry(screen));
|
||||
//The problem related to the full screen on linux seems to be resolved
|
||||
// with Qt 5.5 at least on Debian but define macro anyway
|
||||
#ifdef Q_OS_LINUX
|
||||
setWindowFlags(Qt::Window);
|
||||
setVisible(true);
|
||||
setWindowState( windowState() ^ Qt::WindowFullScreen );
|
||||
show();
|
||||
setWindowFlags(Qt::Window);
|
||||
setVisible(true);
|
||||
setWindowState( windowState() ^ Qt::WindowFullScreen );
|
||||
show();
|
||||
#else
|
||||
showFullScreen();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
show();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (QApplication::desktop()->screenCount() > 1) {
|
||||
#ifdef Q_OS_LINUX
|
||||
setWindowFlags( windowFlags() & ~Qt::Window );
|
||||
setWindowFlags( windowFlags() & ~Qt::Window );
|
||||
#else
|
||||
showNormal();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user