From 6a991d580b60d0a572dbe1a0fea9a96677f05a61 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 17 Dec 2024 20:34:19 +0100 Subject: [PATCH] Qt: try QCursor::setPos with absolute position for wayland --- rpcs3/Input/basic_mouse_handler.cpp | 2 +- rpcs3/Input/keyboard_pad_handler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Input/basic_mouse_handler.cpp b/rpcs3/Input/basic_mouse_handler.cpp index d9435ef95e..f4948998b7 100644 --- a/rpcs3/Input/basic_mouse_handler.cpp +++ b/rpcs3/Input/basic_mouse_handler.cpp @@ -208,7 +208,7 @@ void basic_mouse_handler::MouseMove(QMouseEvent* event) QPoint p_center = m_target->geometry().topLeft() + QPoint(screen.width() / 2, screen.height() / 2); // reset the mouse to the center for consistent results since edge movement won't be registered - QCursor::setPos(m_target->screen(), p_center); + QCursor::setPos(m_target->screen()->geometry().topLeft() + p_center); // convert the center into screen coordinates p_center = m_target->mapFromGlobal(p_center); diff --git a/rpcs3/Input/keyboard_pad_handler.cpp b/rpcs3/Input/keyboard_pad_handler.cpp index 11901800c2..370b97bfe9 100644 --- a/rpcs3/Input/keyboard_pad_handler.cpp +++ b/rpcs3/Input/keyboard_pad_handler.cpp @@ -546,7 +546,7 @@ void keyboard_pad_handler::mouseMoveEvent(QMouseEvent* event) QPoint p_center = m_target->geometry().topLeft() + QPoint(screen.width() / 2, screen.height() / 2); // reset the mouse to the center for consistent results since edge movement won't be registered - QCursor::setPos(m_target->screen(), p_center); + QCursor::setPos(m_target->screen()->geometry().topLeft() + p_center); // convert the center into screen coordinates p_center = m_target->mapFromGlobal(p_center);