Merge pull request #15478 from amerhifi/feature/systemMouse

Case 22378: System cursor in desktop mode instead of rendering texture from Displayplugin
This commit is contained in:
Sam Gateau 2019-04-30 20:17:18 -07:00 committed by GitHub
commit c1ee4deb12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View file

@ -3591,7 +3591,14 @@ void Application::setPreferAvatarFingerOverStylus(bool value) {
void Application::setPreferredCursor(const QString& cursorName) { void Application::setPreferredCursor(const QString& cursorName) {
qCDebug(interfaceapp) << "setPreferredCursor" << cursorName; qCDebug(interfaceapp) << "setPreferredCursor" << cursorName;
_preferredCursor.set(cursorName.isEmpty() ? DEFAULT_CURSOR_NAME : cursorName);
if (_displayPlugin && _displayPlugin->isHmd()) {
_preferredCursor.set(cursorName.isEmpty() ? DEFAULT_CURSOR_NAME : cursorName);
}
else {
_preferredCursor.set(cursorName.isEmpty() ? Cursor::Manager::getIconName(Cursor::Icon::SYSTEM) : cursorName);
}
showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get())); showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
} }
@ -5041,7 +5048,7 @@ void Application::idle() {
} }
} }
#endif #endif
checkChangeCursor(); checkChangeCursor();
#if !defined(DISABLE_QML) #if !defined(DISABLE_QML)

View file

@ -38,6 +38,7 @@
#include <gpu/gl/GLBackend.h> #include <gpu/gl/GLBackend.h>
#include <GeometryCache.h> #include <GeometryCache.h>
#include <CursorManager.h>
#include <FramebufferCache.h> #include <FramebufferCache.h>
#include <shared/NsightHelpers.h> #include <shared/NsightHelpers.h>
#include <ui-plugins/PluginContainer.h> #include <ui-plugins/PluginContainer.h>
@ -681,11 +682,14 @@ void OpenGLDisplayPlugin::compositeLayers() {
compositeExtra(); compositeExtra();
} }
// Draw the pointer last so it's on top of everything auto& cursorManager = Cursor::Manager::instance();
auto compositorHelper = DependencyManager::get<CompositorHelper>(); if (isHmd() || cursorManager.getCursor()->getIcon() == Cursor::RETICLE) {
if (compositorHelper->getReticleVisible()) { auto compositorHelper = DependencyManager::get<CompositorHelper>();
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount()) // Draw the pointer last so it's on top of everything
if (compositorHelper->getReticleVisible()) {
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount())
compositePointer(); compositePointer();
}
} }
} }