From 601a35a9b66796df421f1a48fe1009f9c1b6e3aa Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 24 Jan 2017 15:49:49 -0800 Subject: [PATCH] try a different way of repairing tablet after a domain change --- interface/src/ui/AddressBarDialog.cpp | 18 +++++++++--------- scripts/system/tablet-ui/tabletUI.js | 7 ++++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/interface/src/ui/AddressBarDialog.cpp b/interface/src/ui/AddressBarDialog.cpp index 88e0b6b847..b687bfef88 100644 --- a/interface/src/ui/AddressBarDialog.cpp +++ b/interface/src/ui/AddressBarDialog.cpp @@ -17,7 +17,7 @@ #include "DependencyManager.h" #include "AddressManager.h" #include "DialogsManager.h" -#include "scripting/HMDScriptingInterface.h" +// #include "scripting/HMDScriptingInterface.h" HIFI_QML_DEF(AddressBarDialog) @@ -40,10 +40,10 @@ AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(pare _backEnabled = !(DependencyManager::get()->getBackStack().isEmpty()); _forwardEnabled = !(DependencyManager::get()->getForwardStack().isEmpty()); connect(addressManager.data(), &AddressManager::hostChanged, this, &AddressBarDialog::metaverseServerUrlChanged); - connect(addressManager.data(), &AddressManager::hostChanged, [](){ - auto HMD = DependencyManager::get(); - HMD->setShouldShowTablet(false); - }); + // connect(addressManager.data(), &AddressManager::hostChanged, [](){ + // auto HMD = DependencyManager::get(); + // HMD->setShouldShowTablet(false); + // }); connect(DependencyManager::get().data(), &DialogsManager::setUseFeed, this, &AddressBarDialog::setUseFeed); connect(qApp, &Application::receivedHifiSchemeURL, this, &AddressBarDialog::receivedHifiSchemeURL); } @@ -51,8 +51,8 @@ AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(pare void AddressBarDialog::loadAddress(const QString& address, bool fromSuggestions) { qDebug() << "Called LoadAddress with address " << address; if (!address.isEmpty()) { - auto HMD = DependencyManager::get(); - HMD->setShouldShowTablet(false); + // auto HMD = DependencyManager::get(); + // HMD->setShouldShowTablet(false); DependencyManager::get()->handleLookupString(address, fromSuggestions); } } @@ -64,8 +64,8 @@ void AddressBarDialog::loadHome() { if (homeLocation == "") { homeLocation = DEFAULT_HOME_LOCATION; } - auto HMD = DependencyManager::get(); - HMD->setShouldShowTablet(false); + // auto HMD = DependencyManager::get(); + // HMD->setShouldShowTablet(false); DependencyManager::get()->handleLookupString(homeLocation); } diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index f625b087d5..5db29b2738 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -54,7 +54,12 @@ tablet.updateAudioBar(currentMicLevel); } - if (HMD.showTablet && !tabletShown) { + if (tabletShown && UIWebTablet && Overlays.getOverlayType(UIWebTablet.webOverlayID) != "web3d") { + // when we switch domains, the tablet entity gets destroyed and recreated. this causes + // the overlay to be deleted, but not recreated. repair this situation here: + hideTabletUI(); + showTabletUI(); + } else if (HMD.showTablet && !tabletShown) { showTabletUI(); } else if (!HMD.showTablet && tabletShown) { hideTabletUI();