diff --git a/BUILD.md b/BUILD.md index bd264a74ad..c9bb48d4b7 100644 --- a/BUILD.md +++ b/BUILD.md @@ -106,3 +106,4 @@ The following build options can be used when running CMake #### Devices You can support external input/output devices such as Leap Motion, MIDI, and more by adding each individual SDK in the visible building path. Refer to the readme file available in each device folder in [interface/external/](interface/external) for the detailed explanation of the requirements to use the device. + \ No newline at end of file diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index 2d5c68c0e8..e3cd492edb 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -13,15 +13,14 @@ import QtQuick 2.4 import controlsUit 1.0 as HifiControlsUit import stylesUit 1.0 as HifiStylesUit -import "LoginDialog" - FocusScope { id: root - HifiStylesUit.HifiConstants { id: hifi } objectName: "LoginDialog" property bool shown: true visible: shown + HifiStylesUit.HifiConstants { id: hifi } + anchors.fill: parent readonly property bool isTablet: false @@ -33,12 +32,17 @@ FocusScope { property bool keyboardRaised: false property bool punctuationMode: false property bool isPassword: false - property string title: "" - property string text: "" - property int titleWidth: 0 + property alias bannerWidth: banner.width property alias bannerHeight: banner.height + property string title: "" + property string text: "" + + property int titleWidth: 0 + + property bool isHMD: HMD.active + function tryDestroy() { root.destroy() } diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index 8d6444bc0e..b01bb5b761 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -23,43 +23,36 @@ FocusScope { objectName: "LoginDialog" visible: true + HifiStylesUit.HifiConstants { id: hifi } + anchors.fill: parent - width: parent.width - height: parent.height - property var tabletProxy: Tablet.getTablet("com.highfidelity.interface.tablet.system"); - - property bool isHMD: HMD.active - property bool gotoPreviousApp: false; + readonly property bool isTablet: true + readonly property bool isOverlay: false + property string iconText: hifi.glyphs.avatar + property int iconSize: 35 property bool keyboardEnabled: false property bool keyboardRaised: false property bool punctuationMode: false property bool isPassword: false - readonly property bool isTablet: true - readonly property bool isOverlay: false - property alias text: loginKeyboard.mirroredText - - property int titleWidth: 0 property alias bannerWidth: banner.width property alias bannerHeight: banner.height - property string iconText: hifi.glyphs.avatar - property int iconSize: 35 - property var pane: QtObject { - property real width: root.width - property real height: root.height - } + property int titleWidth: 0 - function tryDestroy() { - tabletProxy.gotoHomeScreen(); - } + property bool isHMD: HMD.active - MouseArea { - width: root.width - height: root.height - } + // TABLET SPECIFIC PROPERTIES START // + property alias text: loginKeyboard.mirroredText + + width: parent.width + height: parent.height + + property var tabletProxy: Tablet.getTablet("com.highfidelity.interface.tablet.system") + + property bool gotoPreviousApp: false property bool keyboardOverride: true @@ -70,7 +63,20 @@ FocusScope { property alias loginDialog: loginDialog property alias hifi: hifi - HifiStylesUit.HifiConstants { id: hifi } + property var pane: QtObject { + property real width: root.width + property real height: root.height + } + + MouseArea { + width: root.width + height: root.height + } + // TABLET SPECIFIC PROPERTIES END // + + function tryDestroy() { + tabletProxy.gotoHomeScreen(); + } Timer { id: keyboardTimer @@ -102,6 +108,15 @@ FocusScope { anchors.fill: parent } + Rectangle { + z: -6 + id: opaqueRect + height: parent.height + width: parent.width + opacity: 0.65 + color: "black" + } + Item { z: -5 id: bannerContainer @@ -119,15 +134,6 @@ FocusScope { } } - Rectangle { - z: -6 - id: opaqueRect - height: parent.height - width: parent.width - opacity: 0.65 - color: "black" - } - HifiControlsUit.Keyboard { id: loginKeyboard raised: root.keyboardEnabled && root.keyboardRaised diff --git a/interface/resources/qml/hifi/Desktop.qml b/interface/resources/qml/hifi/Desktop.qml index 5fa6234504..3239471a00 100644 --- a/interface/resources/qml/hifi/Desktop.qml +++ b/interface/resources/qml/hifi/Desktop.qml @@ -12,6 +12,8 @@ import controlsUit 1.0 OriginalDesktop.Desktop { id: desktop + property alias toolbarObjectName: sysToolbar.objectName + MouseArea { id: hoverWatch anchors.fill: parent @@ -70,7 +72,12 @@ OriginalDesktop.Desktop { x: sysToolbar.x buttonModel: tablet ? tablet.buttons : null; shown: tablet ? tablet.toolbarMode : false; + + onVisibleChanged: { + desktop.toolbarVisibleChanged(visible, sysToolbar.objectName); + } } + signal toolbarVisibleChanged(bool isVisible, string toolbarName); QtSettings.Settings { id: settings; diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index 957df6d584..ef9a3cbe24 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -122,7 +122,7 @@ Rectangle { Tablet.playSound(TabletEnums.ButtonClick); // Can't use `Window.location` in QML, so just use what setting `Window.location` actually calls under the hood: // AddressManager.handleLookupString(). - AddressManager.handleLookupString(LocationBookmarks.getHomeLocationAddress()); + AddressManager.handleLookupString(LocationBookmarks.getAddress("hqhome")); } } } diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml index 85b3cf149f..6e86849d03 100644 --- a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml @@ -47,6 +47,11 @@ Rectangle { onSkeletonModelURLChanged: { root.updatePreviewUrl(); + + if (MyAvatar.skeletonModelURL.indexOf("defaultAvatar" > -1) && topBarInventoryModel.count > 0) { + Settings.setValue("simplifiedUI/alreadyAutoSelectedAvatar", true); + MyAvatar.skeletonModelURL = topBarInventoryModel.get(0).download_url; + } } } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2f9a151c2f..f9470782bf 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2708,6 +2708,7 @@ void Application::cleanupBeforeQuit() { } getEntities()->shutdown(); // tell the entities system we're shutting down, so it will stop running scripts + getEntities()->clear(); // Clear any queued processing (I/O, FBX/OBJ/Texture parsing) QThreadPool::globalInstance()->clear(); diff --git a/interface/src/PerformanceManager.cpp b/interface/src/PerformanceManager.cpp index cf6da11aeb..0a028f95cc 100644 --- a/interface/src/PerformanceManager.cpp +++ b/interface/src/PerformanceManager.cpp @@ -63,9 +63,15 @@ PerformanceManager::PerformancePreset PerformanceManager::getPerformancePreset() void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformancePreset preset) { + // Ugly case that prevent us to run deferred everywhere... + bool isDeferredCapable = platform::Profiler::isRenderMethodDeferredCapable(); + switch (preset) { case PerformancePreset::HIGH: - RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED); + RenderScriptingInterface::getInstance()->setRenderMethod( ( isDeferredCapable ? + RenderScriptingInterface::RenderMethod::DEFERRED : + RenderScriptingInterface::RenderMethod::FORWARD ) ); + RenderScriptingInterface::getInstance()->setShadowsEnabled(true); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME); @@ -73,7 +79,10 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP break; case PerformancePreset::MID: - RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED); + RenderScriptingInterface::getInstance()->setRenderMethod((isDeferredCapable ? + RenderScriptingInterface::RenderMethod::DEFERRED : + RenderScriptingInterface::RenderMethod::FORWARD)); + RenderScriptingInterface::getInstance()->setShadowsEnabled(false); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE); DependencyManager::get()->setWorldDetailQuality(0.5f); diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index bb8b7ba7f4..efe3d59d90 100755 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -490,7 +490,7 @@ void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transact _myAvatar->getCharacterController()->buildPhysicsTransaction(transaction); for (auto avatar : _otherAvatarsToChangeInPhysics) { bool isInPhysics = avatar->isInPhysicsSimulation(); - if (isInPhysics != avatar->shouldBeInPhysicsSimulation()) { + if (isInPhysics != avatar->shouldBeInPhysicsSimulation() || avatar->_needsReinsertion) { if (isInPhysics) { transaction.objectsToRemove.push_back(avatar->_motionState); avatar->_motionState = nullptr; diff --git a/launchers/darwin/images/interface.icns b/launchers/darwin/images/interface.icns index 4aeb8301ce..8dadfd5037 100644 Binary files a/launchers/darwin/images/interface.icns and b/launchers/darwin/images/interface.icns differ diff --git a/launchers/darwin/src/Launcher.m b/launchers/darwin/src/Launcher.m index f586269864..d60c4080a2 100644 --- a/launchers/darwin/src/Launcher.m +++ b/launchers/darwin/src/Launcher.m @@ -46,6 +46,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; } -(void)awakeFromNib { + [[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE]; [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(didTerminateApp:) name:NSWorkspaceDidTerminateApplicationNotification @@ -114,6 +115,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; userInfo:nil repeats:NO]; } + [[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE]; } - (void) setDownloadContextFilename:(NSString *)aFilename @@ -277,6 +279,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; -(void)onSplashScreenTimerFinished:(NSTimer *)timer { + [[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE]; [self showLoginScreen]; } @@ -336,6 +339,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; NSString* scriptsPath = [[self getAppPath] stringByAppendingString:@"interface.app/Contents/Resources/scripts/simplifiedUI/"]; NSString* domainUrl = [[Settings sharedSettings] getDomainUrl]; NSString* userToken = [[Launcher sharedLauncher] getTokenString]; + NSString* homeBookmark = [[NSString stringWithFormat:@"hqhome="] stringByAppendingString:domainUrl]; NSArray* arguments; if (userToken != nil) { arguments = [NSArray arrayWithObjects: @@ -344,6 +348,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; @"--cache", contentPath, @"--displayName", displayName, @"--scripts", scriptsPath, + @"--setBookmark", homeBookmark, @"--no-updater", @"--no-launcher", nil]; } else { @@ -351,6 +356,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; @"--url" , domainUrl, @"--cache", contentPath, @"--scripts", scriptsPath, + @"--setBookmark", homeBookmark, @"--no-updater", @"--no-launcher", nil]; } diff --git a/launchers/win32/LauncherManager.cpp b/launchers/win32/LauncherManager.cpp index 35903a0887..fc79287457 100644 --- a/launchers/win32/LauncherManager.cpp +++ b/launchers/win32/LauncherManager.cpp @@ -234,9 +234,10 @@ HWND LauncherManager::launchApplication() { CString parsedTokens = _tokensJSON; parsedTokens.Replace(_T("\""), _T("\\\"")); tokensParam = _T("--tokens \""); - tokensParam += parsedTokens + _T("\""); + tokensParam += parsedTokens + _T("\" "); } - CString params = urlParam + scriptsParam + cacheParam + nameParam + tokensParam + EXTRA_PARAMETERS; + CString bookmarkParam = _T("--setBookmark hqhome=\"") + _domainURL + ("\" "); + CString params = urlParam + scriptsParam + cacheParam + nameParam + tokensParam + bookmarkParam + EXTRA_PARAMETERS; _shouldLaunch = FALSE; return LauncherUtils::executeOnForeground(interfaceExe, params); } diff --git a/launchers/win32/res/interface.ico b/launchers/win32/res/interface.ico index cdd4792f56..09a97956a7 100644 Binary files a/launchers/win32/res/interface.ico and b/launchers/win32/res/interface.ico differ diff --git a/libraries/entities/src/WebEntityItem.cpp b/libraries/entities/src/WebEntityItem.cpp index 0748790df9..b40de7e42a 100644 --- a/libraries/entities/src/WebEntityItem.cpp +++ b/libraries/entities/src/WebEntityItem.cpp @@ -343,4 +343,4 @@ PulsePropertyGroup WebEntityItem::getPulseProperties() const { return resultWithReadLock([&] { return _pulseProperties; }); -} \ No newline at end of file +} diff --git a/libraries/platform/src/platform/Profiler.cpp b/libraries/platform/src/platform/Profiler.cpp index f77bbec46b..bd8efb9097 100644 --- a/libraries/platform/src/platform/Profiler.cpp +++ b/libraries/platform/src/platform/Profiler.cpp @@ -12,6 +12,7 @@ #include "Platform.h" #include "PlatformKeys.h" +#include using namespace platform; @@ -124,4 +125,35 @@ bool filterOnProcessors(const platform::json& computer, const platform::json& cp // Not able to profile return false; -} \ No newline at end of file +} + +// Ugly very adhoc capability check to know if a particular hw can REnder with Deferred method or not +// YES for PC windows and linux +// NO for android +// YES on macos EXCEPT for macbookair with gpu intel iris or intel HD 6000 +bool Profiler::isRenderMethodDeferredCapable() { +#if defined(Q_OS_MAC) + auto computer = platform::getComputer(); + const auto computerModel = (computer.count(keys::computer::model) ? computer[keys::computer::model].get() : ""); + + auto gpuInfo = platform::getGPU(0); + const auto gpuModel = (gpuInfo.count(keys::gpu::model) ? gpuInfo[keys::gpu::model].get() : ""); + + + // Macbook air 2018 are a problem + if ((computerModel.find("MacBookAir") != std::string::npos) && (gpuModel.find("Intel HD Graphics 6000") != std::string::npos)) { + return false; + } + + // We know for fact that one INtel Iris is problematic, not enough info yet for sure + // if ((gpuModel.find("Intel Iris ....") != std::string::npos)) { + // return false; + //} + + return true; +#elif defined(Q_OS_ANDROID) + return false; +#else + return true; +#endif +} diff --git a/libraries/platform/src/platform/Profiler.h b/libraries/platform/src/platform/Profiler.h index fea0622c89..c47f2587f2 100644 --- a/libraries/platform/src/platform/Profiler.h +++ b/libraries/platform/src/platform/Profiler.h @@ -28,6 +28,9 @@ public: static const std::array TierNames; static Tier profilePlatform(); + + // Ugly very adhoc capability check to know if a particular hw can REnder with Deferred method or not + static bool isRenderMethodDeferredCapable(); }; } diff --git a/libraries/shared/src/GPUIdent.cpp b/libraries/shared/src/GPUIdent.cpp index d5c2f3ec6c..f092a56c17 100644 --- a/libraries/shared/src/GPUIdent.cpp +++ b/libraries/shared/src/GPUIdent.cpp @@ -47,6 +47,7 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer) GLint rendererInfoCount; CGLError err = CGLQueryRendererInfo(cglDisplayMask, &rendererInfo, &rendererInfoCount); GLint j, numRenderers = 0, deviceVRAM, bestVRAM = 0; + int bestGPUid = 0; err = CGLQueryRendererInfo(cglDisplayMask, &rendererInfo, &numRenderers); if (0 == err) { // Iterate over all of them and use the figure for the one with the most VRAM, @@ -55,6 +56,7 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer) for (j = 0; j < numRenderers; j++) { CGLDescribeRenderer(rendererInfo, j, kCGLRPVideoMemoryMegabytes, &deviceVRAM); if (deviceVRAM > bestVRAM) { + bestGPUid = j; bestVRAM = deviceVRAM; _isValid = true; } @@ -78,6 +80,8 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer) for (int i = 0; i < parts.size(); ++i) { if (parts[i].toLower().contains("radeon") || parts[i].toLower().contains("nvidia")) { _name=parts[i]; + } else if (i == bestGPUid) { + _name=parts[i]; } } diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 1e6a01c187..f0b27904ae 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -27,6 +27,7 @@ #include "VrMenu.h" #include "ui/Logging.h" +#include "ui/ToolbarScriptingInterface.h" #include #include "MainWindow.h" @@ -688,6 +689,10 @@ void OffscreenUi::createDesktop(const QUrl& url) { menuInitializer(_vrMenu); } + + auto toolbarScriptingInterface = DependencyManager::get(); + connect(_desktop, SIGNAL(toolbarVisibleChanged(bool, QString)), toolbarScriptingInterface.data(), SIGNAL(toolbarVisibleChanged(bool, QString))); + auto keyboardFocus = new KeyboardFocusHack(); connect(_desktop, SIGNAL(showDesktop()), this, SIGNAL(showDesktop())); emit desktopReady(); diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index ec0fad5ff0..34cac90a05 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -686,43 +686,52 @@ void OffscreenQmlSurface::setKeyboardRaised(QObject* object, bool raised, bool n return; } -#if !defined(Q_OS_ANDROID) - // if HMD is being worn, allow keyboard to open. allow it to close, HMD or not. - if (!raised || qApp->property(hifi::properties::HMD).toBool()) { - QQuickItem* item = dynamic_cast(object); - if (!item) { - return; - } + bool android = false; +#if defined(Q_OS_ANDROID) + android = true; +#endif - // for future probably makes sense to consider one of the following: - // 1. make keyboard a singleton, which will be dynamically re-parented before showing - // 2. track currently visible keyboard somewhere, allow to subscribe for this signal - // any of above should also eliminate need in duplicated properties and code below + bool hmd = qApp->property(hifi::properties::HMD).toBool(); - while (item) { - // Numeric value may be set in parameter from HTML UI; for QML UI, detect numeric fields here. - numeric = numeric || QString(item->metaObject()->className()).left(7) == "SpinBox"; - - if (item->property("keyboardRaised").isValid()) { - // FIXME - HMD only: Possibly set value of "keyboardEnabled" per isHMDMode() for use in WebView.qml. - if (item->property("punctuationMode").isValid()) { - item->setProperty("punctuationMode", QVariant(numeric)); - } - if (item->property("passwordField").isValid()) { - item->setProperty("passwordField", QVariant(passwordField)); - } - - if (raised) { - item->setProperty("keyboardRaised", QVariant(!raised)); - } - - item->setProperty("keyboardRaised", QVariant(raised)); + if (!android || hmd) { + // if HMD is being worn, allow keyboard to open. allow it to close, HMD or not. + if (!raised || hmd) { + QQuickItem* item = dynamic_cast(object); + if (!item) { return; } - item = dynamic_cast(item->parentItem()); + + // for future probably makes sense to consider one of the following: + // 1. make keyboard a singleton, which will be dynamically re-parented before showing + // 2. track currently visible keyboard somewhere, allow to subscribe for this signal + // any of above should also eliminate need in duplicated properties and code below + + while (item) { + // Numeric value may be set in parameter from HTML UI; for QML UI, detect numeric fields here. + numeric = numeric || QString(item->metaObject()->className()).left(7) == "SpinBox"; + + if (item->property("keyboardRaised").isValid()) { + + if (item->property("punctuationMode").isValid()) { + item->setProperty("punctuationMode", QVariant(numeric)); + } + if (item->property("passwordField").isValid()) { + item->setProperty("passwordField", QVariant(passwordField)); + } + + if (hmd && item->property("keyboardEnabled").isValid()) { + item->setProperty("keyboardEnabled", true); + } + + item->setProperty("keyboardRaised", QVariant(raised)); + + return; + } + item = dynamic_cast(item->parentItem()); + } } } -#endif + } void OffscreenQmlSurface::emitScriptEvent(const QVariant& message) { diff --git a/libraries/ui/src/ui/ToolbarScriptingInterface.h b/libraries/ui/src/ui/ToolbarScriptingInterface.h index 409ea28fdc..952d3cce95 100644 --- a/libraries/ui/src/ui/ToolbarScriptingInterface.h +++ b/libraries/ui/src/ui/ToolbarScriptingInterface.h @@ -150,6 +150,9 @@ public: * @returns {ToolbarProxy} */ Q_INVOKABLE ToolbarProxy* getToolbar(const QString& toolbarId); + +signals: + void toolbarVisibleChanged(bool isVisible, QString toolbarName); }; diff --git a/scripts/developer/utilities/render/luci.qml b/scripts/developer/utilities/render/luci.qml index 2dc8fda081..98fd3039d1 100644 --- a/scripts/developer/utilities/render/luci.qml +++ b/scripts/developer/utilities/render/luci.qml @@ -26,8 +26,9 @@ Rectangle { color: global.color ScrollView { - id: control + id: scrollView anchors.fill: parent + contentWidth: parent.width clip: true Column { diff --git a/scripts/developer/utilities/render/performanceSetup.qml b/scripts/developer/utilities/render/performanceSetup.qml index ab00d31f2b..4654736f72 100644 --- a/scripts/developer/utilities/render/performanceSetup.qml +++ b/scripts/developer/utilities/render/performanceSetup.qml @@ -24,9 +24,12 @@ Rectangle { color: global.colorBack ScrollView { + id: scrollView anchors.fill: parent + contentWidth: parent.width clip: true - Column { + + Column { anchors.left: parent.left anchors.right: parent.right @@ -35,8 +38,6 @@ Rectangle { isUnfold: true panelFrameData: Component { PerformanceSettings { - anchors.left: parent.left - anchors.right: parent.right } } } @@ -45,8 +46,6 @@ Rectangle { isUnfold: true panelFrameData: Component { RenderSettings { - anchors.left: parent.left - anchors.right: parent.right } } } @@ -54,8 +53,6 @@ Rectangle { label: "Platform" panelFrameData: Component { Platform { - anchors.left: parent.left - anchors.right: parent.right } } } diff --git a/scripts/simplifiedUI/system/progress.js b/scripts/simplifiedUI/system/progress.js index b373612790..a641dd4556 100644 --- a/scripts/simplifiedUI/system/progress.js +++ b/scripts/simplifiedUI/system/progress.js @@ -83,9 +83,7 @@ // The initial delay cooldown keeps us from tracking progress before the allotted time // has passed. INITIAL_DELAY_COOLDOWN_TIME = 1000, - initialDelayCooldown = 0, - - isInInterstitialMode = false; + initialDelayCooldown = 0; function fade() { @@ -267,7 +265,7 @@ // Update state if (!visible) { // Not visible because no recent downloads - if ((displayProgress < 100 || gpuTextures > 0) && !isInInterstitialMode && !isInterstitialOverlaysVisible) { // Have started downloading so fade in + if (displayProgress < 100 || gpuTextures > 0) { // Have started downloading so fade in visible = true; alphaDelta = ALPHA_DELTA_IN; fadeTimer = Script.setInterval(fade, FADE_INTERVAL); @@ -307,9 +305,6 @@ } else { x = x * BAR_HMD_REPEAT; } - if (isInInterstitialMode || isInterstitialOverlaysVisible) { - visible = false; - } // Update progress bar Overlays.editOverlay(barDesktop.overlay, { @@ -349,10 +344,6 @@ } } - function interstitialModeChanged(inMode) { - isInInterstitialMode = inMode; - } - function setUp() { var is4k = Window.innerWidth > 3000; @@ -378,7 +369,6 @@ } setUp(); - Window.interstitialModeChanged.connect(interstitialModeChanged); GlobalServices.downloadInfoChanged.connect(onDownloadInfoChanged); GlobalServices.updateDownloadInfo(); Script.setInterval(update, 1000 / 60); diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 0553672655..70679b09bd 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -415,7 +415,7 @@ function getInputDeviceMutedOverlayTopY() { var inputDeviceMutedOverlay = false; var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_X_PX = 353; var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_Y_PX = 95; -var INPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX = 20; +var INPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX = 20 + TOP_BAR_HEIGHT_PX; function updateInputDeviceMutedOverlay(isMuted) { if (isMuted) { var props = { @@ -457,16 +457,18 @@ function onGeometryChanged(rect) { } } -var TIMEOUT_BEFORE_REHIDE_TOOLBAR_MS = 700; function onDisplayModeChanged(isHMDMode) { if (isHMDMode) { Camera.setModeString("first person"); - } else if (Settings.getValue("simplifiedUI/keepExistingUIAndScripts", false)) { - // works for now, but not a permanent fix by any means. - Script.setTimeout(function () { - var toolbar = Toolbars.getToolbar(TOOLBAR_NAME); + } +} + +function onToolbarVisibleChanged(isVisible, toolbarName) { + if (isVisible && toolbarName == TOOLBAR_NAME && !Settings.getValue("simplifiedUI/keepExistingUIAndScripts", false)) { + var toolbar = Toolbars.getToolbar(toolbarName); + if (toolbar) { toolbar.writeProperty("visible", false); - }, TIMEOUT_BEFORE_REHIDE_TOOLBAR_MS); + } } } @@ -497,7 +499,9 @@ function startup() { if (!HMD.active) { var toolbar = Toolbars.getToolbar(TOOLBAR_NAME); - toolbar.writeProperty("visible", false); + if (toolbar) { + toolbar.writeProperty("visible", false); + } } } @@ -517,6 +521,7 @@ function startup() { Audio.localInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay); Audio.serverInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay); Audio.systemInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay); + Toolbars.toolbarVisibleChanged.connect(onToolbarVisibleChanged); oldShowAudioTools = AvatarInputs.showAudioTools; AvatarInputs.showAudioTools = false; @@ -544,7 +549,7 @@ function shutdown() { var toolbar = Toolbars.getToolbar(TOOLBAR_NAME); if (toolbar) { toolbar.writeProperty("visible", true); - } + } } } @@ -573,6 +578,7 @@ function shutdown() { Audio.localInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay); Audio.serverInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay); Audio.systemInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay); + Toolbars.toolbarVisibleChanged.disconnect(onToolbarVisibleChanged); AvatarInputs.showAudioTools = oldShowAudioTools; AvatarInputs.showBubbleTools = oldShowBubbleTools;