Showing the changes to interface/src/Application.cpp (1 of 50 files). Show all
Unified · Split
| @@ -135,9 +135,6 @@ using namespace std; · 134 unmodified lines | ||
| 135 | 135 | static unsigned STARFIELD_NUM_STARS = 50000; |
| 136 | 136 | static unsigned STARFIELD_SEED = 1; |
| 137 | 137 | |
| 138 | −static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored | |
| 139 | − | |
| 140 | − | |
| 141 | 138 | const qint64 MAXIMUM_CACHE_SIZE = 10737418240; // 10GB |
| 142 | 139 | |
| 143 | 140 | static QTimer* idleTimer = NULL; |
| @@ -225,6 +222,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 81 unmodified lines | ||
| 225 | 222 | _scaleMirror(1.0f), |
| 226 | 223 | _rotateMirror(0.0f), |
| 227 | 224 | _raiseMirror(0.0f), |
| 225 | + _cursorVisible(true), | |
| 228 | 226 | _lastMouseMove(usecTimestampNow()), |
| 229 | 227 | _lastMouseMoveWasSimulated(false), |
| 230 | 228 | _touchAvgX(0.0f), |
| @@ -1480,6 +1478,8 @@ void Application::setEnableVRMode(bool enableVRMode) { · 1249 unmodified lines | ||
| 1480 | 1478 | |
| 1481 | 1479 | auto glCanvas = DependencyManager::get<GLCanvas>(); |
| 1482 | 1480 | resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); |
| 1481 | + | |
| 1482 | + updateCursorVisibility(); | |
| 1483 | 1483 | } |
| 1484 | 1484 | |
| 1485 | 1485 | void Application::setLowVelocityFilter(bool lowVelocityFilter) { |
| @@ -1947,35 +1947,22 @@ void Application::updateCursor(float deltaTime) { · 461 unmodified lines | ||
| 1947 | 1947 | |
| 1948 | 1948 | static QPoint lastMousePos = QPoint(); |
| 1949 | 1949 | _lastMouseMove = (lastMousePos == QCursor::pos()) ? _lastMouseMove : usecTimestampNow(); |
| 1950 | − bool hideMouse = false; | |
| 1951 | − bool underMouse = QGuiApplication::topLevelAt(QCursor::pos()) == | |
| 1952 | − Application::getInstance()->getWindow()->windowHandle(); | |
| 1953 | − | |
| 1954 | − static const int HIDE_CURSOR_TIMEOUT = 3 * USECS_PER_SECOND; // 3 second | |
| 1955 | − int elapsed = usecTimestampNow() - _lastMouseMove; | |
| 1956 | − if ((elapsed > HIDE_CURSOR_TIMEOUT) || | |
| 1957 | − (OculusManager::isConnected() && Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode))) { | |
| 1958 | − hideMouse = underMouse; | |
| 1959 | − } | |
| 1960 | − | |
| 1961 | − setCursorVisible(!hideMouse); | |
| 1962 | 1950 | lastMousePos = QCursor::pos(); |
| 1963 | 1951 | } |
| 1964 | 1952 | |
| 1965 | −void Application::setCursorVisible(bool visible) { | |
| 1966 | − if (visible) { | |
| 1967 | − if (overrideCursor() != NULL) { | |
| 1968 | − restoreOverrideCursor(); | |
| 1969 | − } | |
| 1953 | +void Application::updateCursorVisibility() { | |
| 1954 | + if (!_cursorVisible || Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode)) { | |
| 1955 | + DependencyManager::get<GLCanvas>()->setCursor(Qt::BlankCursor); | |
| 1970 | 1956 | } else { |
| 1971 | − if (overrideCursor() != NULL) { | |
| 1972 | − changeOverrideCursor(Qt::BlankCursor); | |
| 1973 | − } else { | |
| 1974 | − setOverrideCursor(Qt::BlankCursor); | |
| 1975 | − } | |
| 1957 | + DependencyManager::get<GLCanvas>()->unsetCursor(); | |
| 1976 | 1958 | } |
| 1977 | 1959 | } |
| 1978 | 1960 | |
| 1961 | +void Application::setCursorVisible(bool visible) { | |
| 1962 | + _cursorVisible = visible; | |
| 1963 | + updateCursorVisibility(); | |
| 1964 | +} | |
| 1965 | + | |
| 1979 | 1966 | void Application::update(float deltaTime) { |
| 1980 | 1967 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 1981 | 1968 | PerformanceWarning warn(showWarnings, "Application::update()"); |