Bug: fix unhide on mouse movement only responding to clicks

Previously the unhide of movement mouse_timer reset occurred within case MouseButtonPress.

Additionally, there was a redundant expression in the if statement for cursor locking.
This commit is contained in:
sowens99 2021-09-23 21:13:28 -04:00
parent f19da1cf92
commit 5145853351

View file

@ -362,16 +362,18 @@ bool RenderWidget::event(QEvent* event)
{
// Lock the cursor with any mouse button click (behave the same as window focus change).
// This event is occasionally missed because isActiveWindow is laggy
if (Settings::Instance().GetLockCursor() && event->type() == QEvent::MouseButtonPress)
if (Settings::Instance().GetLockCursor())
{
SetCursorLocked(true);
}
// Unhide on movement
if (!Settings::Instance().GetHideCursor())
{
setCursor(Qt::ArrowCursor);
m_mouse_timer->start(MOUSE_HIDE_DELAY);
}
}
break;
case QEvent::MouseMove:
// Unhide on movement
if (!Settings::Instance().GetHideCursor())
{
setCursor(Qt::ArrowCursor);
m_mouse_timer->start(MOUSE_HIDE_DELAY);
}
break;
case QEvent::WinIdChange: