From 20025b2ffda17f217d587db96c87fee5e1452548 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 29 Mar 2020 01:12:27 +1000 Subject: [PATCH] Qt: Hide mouse cursor in fullscreen mode Fixes #135. --- src/duckstation-qt/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 62709b024..c3d023488 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -103,9 +104,11 @@ void MainWindow::setFullscreen(bool fullscreen) m_ui.mainContainer->removeWidget(m_display_widget); m_display_widget->setParent(nullptr); m_display_widget->showFullScreen(); + m_display_widget->setCursor(Qt::BlankCursor); } else { + m_display_widget->setCursor(QCursor()); m_ui.mainContainer->insertWidget(1, m_display_widget); m_ui.mainContainer->setCurrentIndex(1); } @@ -572,7 +575,7 @@ void MainWindow::closeEvent(QCloseEvent* event) void MainWindow::changeEvent(QEvent* event) { - if (static_cast(event)->oldState()& Qt::WindowMinimized) + if (static_cast(event)->oldState() & Qt::WindowMinimized) { // TODO: This should check the render-to-main option. if (m_display_widget)