From 771b0ffc3792ffeca10baa88d6a62e3889060236 Mon Sep 17 00:00:00 2001 From: BearOso Date: Wed, 1 May 2024 16:09:44 -0500 Subject: [PATCH] Qt: Mouse fixes. --- qt/src/EmuMainWindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qt/src/EmuMainWindow.cpp b/qt/src/EmuMainWindow.cpp index 83bc36c9..1706c72e 100644 --- a/qt/src/EmuMainWindow.cpp +++ b/qt/src/EmuMainWindow.cpp @@ -565,6 +565,8 @@ bool EmuMainWindow::event(QEvent *event) auto center = mapToGlobal(rect().center()); auto pos = QCursor::pos(); auto delta = pos - center; + if (delta.x() == 0 && delta.y() == 0) + break; app->reportPointer(delta.x(), delta.y()); QCursor::setPos(center); } @@ -729,11 +731,11 @@ void EmuMainWindow::toggleMouseGrab() if (mouse_grabbed) { - canvas->setCursor(QCursor(Qt::CursorShape::BlankCursor)); + canvas->setCursor(QCursor(Qt::BlankCursor)); QCursor::setPos(mapToGlobal(rect().center())); } else { - canvas->setCursor(QCursor(Qt::CursorShape::ArrowCursor)); + canvas->setCursor(QCursor(Qt::ArrowCursor)); } } \ No newline at end of file