From c6ee3f46ba98419e376cd9d27e0c7925f38b96c4 Mon Sep 17 00:00:00 2001 From: Purple <38256064+IamSanjid@users.noreply.github.com> Date: Fri, 8 Apr 2022 01:39:27 +0600 Subject: [PATCH] resetting cursor position if somehow leaves the window in panning mode If the mouse DPI is high enough or the rendering window size is small enough the mouse cursor can leave the window, which can cause some annoying behavior, just in case a workaround for that issue. --- src/yuzu/main.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index ab95a7518e..b399e9b011 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -328,6 +328,7 @@ private: void UpdateUISettings(); void HideMouseCursor(); void ShowMouseCursor(); + void CenterMouseCursor(); void OpenURL(const QUrl& url); void LoadTranslation(); void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); @@ -372,6 +373,7 @@ private: bool auto_paused = false; bool auto_muted = false; QTimer mouse_hide_timer; + QTimer mouse_center_timer; // FS std::shared_ptr vfs; @@ -418,4 +420,5 @@ protected: void dropEvent(QDropEvent* event) override; void dragEnterEvent(QDragEnterEvent* event) override; void dragMoveEvent(QDragMoveEvent* event) override; + void leaveEvent(QEvent* event) override; };