mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:37:31 +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()");
|
PerformanceWarning warn(showWarnings, "Application::updateCursor()");
|
||||||
|
|
||||||
bool hideMouse = false;
|
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
|
static const int HIDE_CURSOR_TIMEOUT = 3 * USECS_PER_SECOND; // 3 second
|
||||||
int elapsed = usecTimestampNow() - _lastMouseMove;
|
int elapsed = usecTimestampNow() - _lastMouseMove;
|
||||||
if ((elapsed > HIDE_CURSOR_TIMEOUT && underMouse) ||
|
if ((elapsed > HIDE_CURSOR_TIMEOUT) ||
|
||||||
(OculusManager::isConnected() && Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode))) {
|
(OculusManager::isConnected() && Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode))) {
|
||||||
hideMouse = true;
|
hideMouse = underMouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
setCursorVisible(!hideMouse);
|
setCursorVisible(!hideMouse);
|
||||||
|
|
Loading…
Reference in a new issue