From 600b05fcc9495d023b337feb1f74ba7597d79271 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 26 Nov 2013 14:50:43 -0800 Subject: [PATCH] Oculus mouse pointer fix. --- interface/src/Application.cpp | 13 +++++++------ interface/src/Application.h | 2 -- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3681541244..0574b0ab04 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1469,7 +1469,6 @@ void Application::checkBandwidthMeterClick() { void Application::setFullscreen(bool fullscreen) { _window->setWindowState(fullscreen ? (_window->windowState() | Qt::WindowFullScreen) : (_window->windowState() & ~Qt::WindowFullScreen)); - updateCursor(); } void Application::setRenderVoxels(bool voxelRender) { @@ -2391,6 +2390,13 @@ void Application::updateCursor(float deltaTime) { bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); PerformanceWarning warn(showWarnings, "Application::updateCursor()"); + // in fullscreen Oculus mode, always hide cursor + if (OculusManager::isConnected() && _window->windowState().testFlag(Qt::WindowFullScreen)) { + getGLWidget()->setCursor(Qt::BlankCursor); + _mouseHidden = true; + return; + } + // watch mouse position, if it hasn't moved, hide the cursor bool underMouse = _glWidget->underMouse(); if (!_mouseHidden) { @@ -4090,11 +4096,6 @@ void Application::setMenuShortcutsEnabled(bool enabled) { setShortcutsEnabled(_window->menuBar(), enabled); } -void Application::updateCursor() { - _glWidget->setCursor(OculusManager::isConnected() && _window->windowState().testFlag(Qt::WindowFullScreen) ? - Qt::BlankCursor : Qt::ArrowCursor); -} - void Application::attachNewHeadToNode(Node* newNode) { if (newNode->getLinkedData() == NULL) { newNode->setLinkedData(new Avatar(newNode)); diff --git a/interface/src/Application.h b/interface/src/Application.h index 2213045bc9..cd7a46b4e4 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -288,8 +288,6 @@ private: void setMenuShortcutsEnabled(bool enabled); - void updateCursor(); - static void attachNewHeadToNode(Node *newNode); static void* networkReceive(void* args); // network receive thread