mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 11:54:20 +02:00
Don't hide mouse when over a widget
This commit is contained in:
parent
7f4936770b
commit
df66a0049b
1 changed files with 4 additions and 3 deletions
|
@ -2284,13 +2284,14 @@ void Application::updateCursor(float deltaTime) {
|
|||
PerformanceWarning warn(showWarnings, "Application::updateCursor()");
|
||||
|
||||
bool hideMouse = false;
|
||||
bool underMouse = _glWidget->underMouse();
|
||||
bool underMouse = QGuiApplication::topLevelAt(QCursor::pos()) ==
|
||||
Application::getInstance()->getWindow()->windowHandle();
|
||||
|
||||
static const int HIDE_CURSOR_TIMEOUT = 3 * USECS_PER_SECOND; // 3 second
|
||||
int elapsed = usecTimestampNow() - _lastMouseMove;
|
||||
if ((elapsed > HIDE_CURSOR_TIMEOUT && underMouse) ||
|
||||
if ((elapsed > HIDE_CURSOR_TIMEOUT) ||
|
||||
(OculusManager::isConnected() && Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode))) {
|
||||
hideMouse = true;
|
||||
hideMouse = underMouse;
|
||||
}
|
||||
|
||||
setCursorVisible(!hideMouse);
|
||||
|
|
Loading…
Reference in a new issue