From 04a4f312155a165a1c1fa1860fc825aac24033af Mon Sep 17 00:00:00 2001 From: Sacha Date: Mon, 4 Nov 2013 22:30:38 +1000 Subject: [PATCH] Qt Desktop: Hide cursor in fullscreen during gameplay, unless on-screen controls are enabled. --- Qt/mainwindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 68af8f52bf..c434e70d83 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -90,6 +90,11 @@ void MainWindow::Update() if (lastUIState != globalUIState) { lastUIState = globalUIState; + if (lastUIState == UISTATE_INGAME && g_Config.bFullScreen && !QApplication::overrideCursor() && !g_Config.bShowTouchControls) + QApplication::setOverrideCursor(QCursor(Qt::BlankCursor)); + if (lastUIState != UISTATE_INGAME && g_Config.bFullScreen && QApplication::overrideCursor()) + QApplication::restoreOverrideCursor(); + UpdateMenus(); } } @@ -546,6 +551,9 @@ void MainWindow::on_action_OptionsFullScreen_triggered() ui->menubar->setVisible(true); ui->statusbar->setVisible(true); SetZoom(g_Config.iInternalResolution); + if (globalUIState == UISTATE_INGAME && QApplication::overrideCursor()) + QApplication::restoreOverrideCursor(); + } else { g_Config.bFullScreen = true; @@ -575,6 +583,9 @@ void MainWindow::on_action_OptionsFullScreen_triggered() dp_yres = pixel_yres; if (gpu) gpu->Resized(); + if (globalUIState == UISTATE_INGAME && !g_Config.bShowTouchControls) + QApplication::setOverrideCursor(QCursor(Qt::BlankCursor)); + } }