From 84384d6e496bf687d1822875329e585411ae0b83 Mon Sep 17 00:00:00 2001 From: Purple <38256064+IamSanjid@users.noreply.github.com> Date: Mon, 11 Apr 2022 05:48:05 +0600 Subject: [PATCH] fixed a major issue, the timer was re-setting if something popups like the controller applet --- src/yuzu/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5438cb36d3..b1a0d83e39 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3595,7 +3595,15 @@ void GMainWindow::dragMoveEvent(QDragMoveEvent* event) { void GMainWindow::leaveEvent(QEvent* event) { if (Settings::values.mouse_panning) { - mouse_center_timer.start(); + const QRect& rect = geometry(); + QPoint position = QCursor::pos(); + + qint32 x = qBound(rect.left(), position.x(), rect.right()); + qint32 y = qBound(rect.top(), position.y(), rect.bottom()); + /* only start the timer if the mouse has left the window bound, the leave event is also triggered when the window looses focus */ + if (x != position.x() || y != position.y()) { + mouse_center_timer.start(); + } event->accept(); } }