From add84b2f3960ef8c374addf7c6e4735b099aad20 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 23 May 2013 17:58:04 -0700 Subject: [PATCH] Hide the cursor when in fullscreen Oculus mode. --- interface/src/Application.cpp | 7 +++++++ interface/src/Application.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c354882778..37b8cf31b6 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1002,6 +1002,7 @@ void Application::setNoise(bool noise) { void Application::setFullscreen(bool fullscreen) { _window->setWindowState(fullscreen ? (_window->windowState() | Qt::WindowFullScreen) : (_window->windowState() & ~Qt::WindowFullScreen)); + updateCursor(); } void Application::setRenderFirstPerson(bool firstPerson) { @@ -1010,6 +1011,7 @@ void Application::setRenderFirstPerson(bool firstPerson) { void Application::setOculus(bool oculus) { resizeGL(_glWidget->width(), _glWidget->height()); + updateCursor(); } void Application::setFrustumOffset(bool frustumOffset) { @@ -2080,6 +2082,11 @@ void Application::setMenuShortcutsEnabled(bool enabled) { setShortcutsEnabled(_window->menuBar(), enabled); } +void Application::updateCursor() { + _glWidget->setCursor(_oculusOn->isChecked() && _window->windowState().testFlag(Qt::WindowFullScreen) ? + Qt::BlankCursor : Qt::ArrowCursor); +} + // when QActionGroup is set to non-exclusive, it doesn't return anything as checked; // hence, we must check ourselves QAction* Application::checkedVoxelModeAction() const { diff --git a/interface/src/Application.h b/interface/src/Application.h index bcdf04bfb6..ca2604b42e 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -128,6 +128,8 @@ private: void setMenuShortcutsEnabled(bool enabled); + void updateCursor(); + QAction* checkedVoxelModeAction() const; static void attachNewHeadToAgent(Agent *newAgent);