Qt: try QCursor::setPos with absolute position for wayland

This commit is contained in:
Megamouse 2024-12-17 20:34:19 +01:00
parent 657ab4261c
commit 6a991d580b
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);