diff --git a/DestinationGLCanvas.cpp b/DestinationGLCanvas.cpp index 5f8e1d2..4fa00b4 100644 --- a/DestinationGLCanvas.cpp +++ b/DestinationGLCanvas.cpp @@ -63,7 +63,7 @@ void DestinationGLCanvas::doDraw(QPainter* painter) // Display crosshair cursor. if (_displayCrosshair) { - const QPoint& cursorPosition = QCursor::pos(); + const QPoint& cursorPosition = this->mapFromGlobal(QCursor::pos()); const QRect& geo = geometry(); if (geo.contains(cursorPosition)) { diff --git a/OutputGLWindow.cpp b/OutputGLWindow.cpp index d39ac6c..0e562df 100644 --- a/OutputGLWindow.cpp +++ b/OutputGLWindow.cpp @@ -38,6 +38,7 @@ OutputGLWindow::OutputGLWindow(MainWindow* mainWindow, QWidget* parent, const QG _geometry = saveGeometry(); _pointerIsVisible = true; + } void OutputGLWindow::setCursorVisible(bool visible) @@ -106,9 +107,6 @@ void OutputGLWindow::setFullScreen(bool fullscreen) // Save window geometry. _geometry = saveGeometry(); - //hide cursor - this->setCursorVisible(false); - // Move window to second screen before fullscreening it. if (QApplication::desktop()->screenCount() > 1) setGeometry(QApplication::desktop()->screenGeometry(1)); @@ -117,7 +115,7 @@ void OutputGLWindow::setFullScreen(bool fullscreen) // Special case for Unity. if (session == "ubuntu" || session == "gnome") { setWindowState( windowState() | Qt::WindowFullScreen | Qt::WindowMaximized); - setWindowFlags(Qt::Dialog); + setWindowFlags(Qt::Window | Qt::WindowStaysOnTopHint); show(); } else { showFullScreen(); @@ -131,8 +129,9 @@ void OutputGLWindow::setFullScreen(bool fullscreen) // Restore geometry of window to what it was before full screen call. restoreGeometry(_geometry); - // Show cursor - this->setCursorVisible(true); + // Keep window to second screen + if (QApplication::desktop()->screenCount() > 1) + setGeometry(QApplication::desktop()->screenGeometry(1)); #ifdef Q_OS_UNIX // Special case for Unity.