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