mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
Merge pull request #3956 from Atlante45/dont_hide_mouse_on_every_window
Don't hide mouse when over a widget
This commit is contained in:
commit
aae000d50e
1 changed files with 4 additions and 3 deletions
|
@ -2281,13 +2281,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