Showing the changes to interface/src/Application.cpp (1 of 50 files). Show all
Unified · Split
| @@ -136,9 +136,6 @@ using namespace std; · 135 unmodified lines | ||
| 136 | 136 | static unsigned STARFIELD_NUM_STARS = 50000; |
| 137 | 137 | static unsigned STARFIELD_SEED = 1; |
| 138 | 138 | |
| 139 | −static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored | |
| 140 | − | |
| 141 | − | |
| 142 | 139 | const qint64 MAXIMUM_CACHE_SIZE = 10737418240; // 10GB |
| 143 | 140 | |
| 144 | 141 | static QTimer* idleTimer = NULL; |
| @@ -257,6 +254,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 112 unmodified lines | ||
| 257 | 254 | _scaleMirror(1.0f), |
| 258 | 255 | _rotateMirror(0.0f), |
| 259 | 256 | _raiseMirror(0.0f), |
| 257 | + _cursorVisible(true), | |
| 260 | 258 | _lastMouseMove(usecTimestampNow()), |
| 261 | 259 | _lastMouseMoveWasSimulated(false), |
| 262 | 260 | _touchAvgX(0.0f), |
| @@ -1516,6 +1514,8 @@ void Application::setEnableVRMode(bool enableVRMode) { · 1253 unmodified lines | ||
| 1516 | 1514 | |
| 1517 | 1515 | auto glCanvas = DependencyManager::get<GLCanvas>(); |
| 1518 | 1516 | resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); |
| 1517 | + | |
| 1518 | + updateCursorVisibility(); | |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | 1521 | void Application::setLowVelocityFilter(bool lowVelocityFilter) { |
| @@ -1983,35 +1983,22 @@ void Application::updateCursor(float deltaTime) { · 461 unmodified lines | ||
| 1983 | 1983 | |
| 1984 | 1984 | static QPoint lastMousePos = QPoint(); |
| 1985 | 1985 | _lastMouseMove = (lastMousePos == QCursor::pos()) ? _lastMouseMove : usecTimestampNow(); |
| 1986 | − bool hideMouse = false; | |
| 1987 | − bool underMouse = QGuiApplication::topLevelAt(QCursor::pos()) == | |
| 1988 | − Application::getInstance()->getWindow()->windowHandle(); | |
| 1989 | − | |
| 1990 | − static const int HIDE_CURSOR_TIMEOUT = 3 * USECS_PER_SECOND; // 3 second | |
| 1991 | − int elapsed = usecTimestampNow() - _lastMouseMove; | |
| 1992 | − if ((elapsed > HIDE_CURSOR_TIMEOUT) || | |
| 1993 | − (OculusManager::isConnected() && Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode))) { | |
| 1994 | − hideMouse = underMouse; | |
| 1995 | − } | |
| 1996 | − | |
| 1997 | − setCursorVisible(!hideMouse); | |
| 1998 | 1986 | lastMousePos = QCursor::pos(); |
| 1999 | 1987 | } |
| 2000 | 1988 | |
| 2001 | −void Application::setCursorVisible(bool visible) { | |
| 2002 | − if (visible) { | |
| 2003 | − if (overrideCursor() != NULL) { | |
| 2004 | − restoreOverrideCursor(); | |
| 2005 | − } | |
| 1989 | +void Application::updateCursorVisibility() { | |
| 1990 | + if (!_cursorVisible || Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode)) { | |
| 1991 | + DependencyManager::get<GLCanvas>()->setCursor(Qt::BlankCursor); | |
| 2006 | 1992 | } else { |
| 2007 | − if (overrideCursor() != NULL) { | |
| 2008 | − changeOverrideCursor(Qt::BlankCursor); | |
| 2009 | − } else { | |
| 2010 | − setOverrideCursor(Qt::BlankCursor); | |
| 2011 | − } | |
| 1993 | + DependencyManager::get<GLCanvas>()->unsetCursor(); | |
| 2012 | 1994 | } |
| 2013 | 1995 | } |
| 2014 | 1996 | |
| 1997 | +void Application::setCursorVisible(bool visible) { | |
| 1998 | + _cursorVisible = visible; | |
| 1999 | + updateCursorVisibility(); | |
| 2000 | +} | |
| 2001 | + | |
| 2015 | 2002 | void Application::update(float deltaTime) { |
| 2016 | 2003 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 2017 | 2004 | PerformanceWarning warn(showWarnings, "Application::update()"); |