mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 13:33:26 +02:00
try a different way of repairing tablet after a domain change
This commit is contained in:
parent
19cf84dd5d
commit
601a35a9b6
2 changed files with 15 additions and 10 deletions
|
@ -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<AddressManager>()->getBackStack().isEmpty());
|
||||
_forwardEnabled = !(DependencyManager::get<AddressManager>()->getForwardStack().isEmpty());
|
||||
connect(addressManager.data(), &AddressManager::hostChanged, this, &AddressBarDialog::metaverseServerUrlChanged);
|
||||
connect(addressManager.data(), &AddressManager::hostChanged, [](){
|
||||
auto HMD = DependencyManager::get<HMDScriptingInterface>();
|
||||
HMD->setShouldShowTablet(false);
|
||||
});
|
||||
// connect(addressManager.data(), &AddressManager::hostChanged, [](){
|
||||
// auto HMD = DependencyManager::get<HMDScriptingInterface>();
|
||||
// HMD->setShouldShowTablet(false);
|
||||
// });
|
||||
connect(DependencyManager::get<DialogsManager>().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<HMDScriptingInterface>();
|
||||
HMD->setShouldShowTablet(false);
|
||||
// auto HMD = DependencyManager::get<HMDScriptingInterface>();
|
||||
// HMD->setShouldShowTablet(false);
|
||||
DependencyManager::get<AddressManager>()->handleLookupString(address, fromSuggestions);
|
||||
}
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ void AddressBarDialog::loadHome() {
|
|||
if (homeLocation == "") {
|
||||
homeLocation = DEFAULT_HOME_LOCATION;
|
||||
}
|
||||
auto HMD = DependencyManager::get<HMDScriptingInterface>();
|
||||
HMD->setShouldShowTablet(false);
|
||||
// auto HMD = DependencyManager::get<HMDScriptingInterface>();
|
||||
// HMD->setShouldShowTablet(false);
|
||||
DependencyManager::get<AddressManager>()->handleLookupString(homeLocation);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue