mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-09 01:29:23 +00:00
Qt: try QCursor::setPos with absolute position for wayland
This commit is contained in:
parent
657ab4261c
commit
6a991d580b
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
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
|
// 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
|
// convert the center into screen coordinates
|
||||||
p_center = m_target->mapFromGlobal(p_center);
|
p_center = m_target->mapFromGlobal(p_center);
|
||||||
|
|
|
@ -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);
|
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
|
// 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
|
// convert the center into screen coordinates
|
||||||
p_center = m_target->mapFromGlobal(p_center);
|
p_center = m_target->mapFromGlobal(p_center);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue