mirror of https://github.com/snes9xgit/snes9x.git
Qt: Mouse fixes.
This commit is contained in:
parent
dcccf28bde
commit
771b0ffc37
|
@ -565,6 +565,8 @@ bool EmuMainWindow::event(QEvent *event)
|
||||||
auto center = mapToGlobal(rect().center());
|
auto center = mapToGlobal(rect().center());
|
||||||
auto pos = QCursor::pos();
|
auto pos = QCursor::pos();
|
||||||
auto delta = pos - center;
|
auto delta = pos - center;
|
||||||
|
if (delta.x() == 0 && delta.y() == 0)
|
||||||
|
break;
|
||||||
app->reportPointer(delta.x(), delta.y());
|
app->reportPointer(delta.x(), delta.y());
|
||||||
QCursor::setPos(center);
|
QCursor::setPos(center);
|
||||||
}
|
}
|
||||||
|
@ -729,11 +731,11 @@ void EmuMainWindow::toggleMouseGrab()
|
||||||
|
|
||||||
if (mouse_grabbed)
|
if (mouse_grabbed)
|
||||||
{
|
{
|
||||||
canvas->setCursor(QCursor(Qt::CursorShape::BlankCursor));
|
canvas->setCursor(QCursor(Qt::BlankCursor));
|
||||||
QCursor::setPos(mapToGlobal(rect().center()));
|
QCursor::setPos(mapToGlobal(rect().center()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canvas->setCursor(QCursor(Qt::CursorShape::ArrowCursor));
|
canvas->setCursor(QCursor(Qt::ArrowCursor));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue