From df66a0049bbbd302e4190ff1411ef3017d68f952 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 11 Dec 2014 15:33:46 -0800 Subject: [PATCH] Don't hide mouse when over a widget --- interface/src/Application.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 32d4557c66..7f10e83b02 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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);