Merge branch 'master' of github.com:highfidelity/hifi into wall

This commit is contained in:
Sam Gateau 2019-06-13 13:32:58 -07:00
commit 60344f1db8
10 changed files with 52 additions and 22 deletions

View file

@ -122,7 +122,7 @@ Rectangle {
Tablet.playSound(TabletEnums.ButtonClick); Tablet.playSound(TabletEnums.ButtonClick);
// Can't use `Window.location` in QML, so just use what setting `Window.location` actually calls under the hood: // Can't use `Window.location` in QML, so just use what setting `Window.location` actually calls under the hood:
// AddressManager.handleLookupString(). // AddressManager.handleLookupString().
AddressManager.handleLookupString(LocationBookmarks.getHomeLocationAddress()); AddressManager.handleLookupString(LocationBookmarks.getAddress("hqhome"));
} }
} }
} }

View file

@ -47,6 +47,11 @@ Rectangle {
onSkeletonModelURLChanged: { onSkeletonModelURLChanged: {
root.updatePreviewUrl(); root.updatePreviewUrl();
if (MyAvatar.skeletonModelURL.indexOf("defaultAvatar" > -1) && topBarInventoryModel.count > 0) {
Settings.setValue("simplifiedUI/alreadyAutoSelectedAvatar", true);
MyAvatar.skeletonModelURL = topBarInventoryModel.get(0).download_url;
}
} }
} }

View file

@ -2708,6 +2708,7 @@ void Application::cleanupBeforeQuit() {
} }
getEntities()->shutdown(); // tell the entities system we're shutting down, so it will stop running scripts 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) // Clear any queued processing (I/O, FBX/OBJ/Texture parsing)
QThreadPool::globalInstance()->clear(); QThreadPool::globalInstance()->clear();

View file

@ -490,7 +490,7 @@ void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transact
_myAvatar->getCharacterController()->buildPhysicsTransaction(transaction); _myAvatar->getCharacterController()->buildPhysicsTransaction(transaction);
for (auto avatar : _otherAvatarsToChangeInPhysics) { for (auto avatar : _otherAvatarsToChangeInPhysics) {
bool isInPhysics = avatar->isInPhysicsSimulation(); bool isInPhysics = avatar->isInPhysicsSimulation();
if (isInPhysics != avatar->shouldBeInPhysicsSimulation()) { if (isInPhysics != avatar->shouldBeInPhysicsSimulation() || avatar->_needsReinsertion) {
if (isInPhysics) { if (isInPhysics) {
transaction.objectsToRemove.push_back(avatar->_motionState); transaction.objectsToRemove.push_back(avatar->_motionState);
avatar->_motionState = nullptr; avatar->_motionState = nullptr;

View file

@ -46,6 +46,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
} }
-(void)awakeFromNib { -(void)awakeFromNib {
[[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
selector:@selector(didTerminateApp:) selector:@selector(didTerminateApp:)
name:NSWorkspaceDidTerminateApplicationNotification name:NSWorkspaceDidTerminateApplicationNotification
@ -114,6 +115,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
userInfo:nil userInfo:nil
repeats:NO]; repeats:NO];
} }
[[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE];
} }
- (void) setDownloadContextFilename:(NSString *)aFilename - (void) setDownloadContextFilename:(NSString *)aFilename
@ -277,6 +279,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
-(void)onSplashScreenTimerFinished:(NSTimer *)timer -(void)onSplashScreenTimerFinished:(NSTimer *)timer
{ {
[[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE];
[self showLoginScreen]; [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* scriptsPath = [[self getAppPath] stringByAppendingString:@"interface.app/Contents/Resources/scripts/simplifiedUI/"];
NSString* domainUrl = [[Settings sharedSettings] getDomainUrl]; NSString* domainUrl = [[Settings sharedSettings] getDomainUrl];
NSString* userToken = [[Launcher sharedLauncher] getTokenString]; NSString* userToken = [[Launcher sharedLauncher] getTokenString];
NSString* homeBookmark = [[NSString stringWithFormat:@"hqhome="] stringByAppendingString:domainUrl];
NSArray* arguments; NSArray* arguments;
if (userToken != nil) { if (userToken != nil) {
arguments = [NSArray arrayWithObjects: arguments = [NSArray arrayWithObjects:
@ -344,6 +348,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
@"--cache", contentPath, @"--cache", contentPath,
@"--displayName", displayName, @"--displayName", displayName,
@"--scripts", scriptsPath, @"--scripts", scriptsPath,
@"--setBookmark", homeBookmark,
@"--no-updater", @"--no-updater",
@"--no-launcher", nil]; @"--no-launcher", nil];
} else { } else {
@ -351,6 +356,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
@"--url" , domainUrl, @"--url" , domainUrl,
@"--cache", contentPath, @"--cache", contentPath,
@"--scripts", scriptsPath, @"--scripts", scriptsPath,
@"--setBookmark", homeBookmark,
@"--no-updater", @"--no-updater",
@"--no-launcher", nil]; @"--no-launcher", nil];
} }

View file

@ -234,9 +234,10 @@ HWND LauncherManager::launchApplication() {
CString parsedTokens = _tokensJSON; CString parsedTokens = _tokensJSON;
parsedTokens.Replace(_T("\""), _T("\\\"")); parsedTokens.Replace(_T("\""), _T("\\\""));
tokensParam = _T("--tokens \""); 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; _shouldLaunch = FALSE;
return LauncherUtils::executeOnForeground(interfaceExe, params); return LauncherUtils::executeOnForeground(interfaceExe, params);
} }

View file

@ -256,18 +256,28 @@ void EntityTreeRenderer::clear() {
} }
// reset the engine // reset the engine
if (_wantScripts && !_shuttingDown) {
resetEntitiesScriptEngine();
}
// remove all entities from the scene
auto scene = _viewState->getMain3DScene(); auto scene = _viewState->getMain3DScene();
if (scene) { if (_shuttingDown) {
for (const auto& entry : _entitiesInScene) { if (scene) {
const auto& renderer = entry.second; render::Transaction transaction;
fadeOutRenderable(renderer); for (const auto& entry : _entitiesInScene) {
const auto& renderer = entry.second;
renderer->removeFromScene(scene, transaction);
}
scene->enqueueTransaction(transaction);
} }
} else { } else {
qCWarning(entitiesrenderer) << "EntitityTreeRenderer::clear(), Unexpected null scene, possibly during application shutdown"; if (_wantScripts) {
resetEntitiesScriptEngine();
}
if (scene) {
for (const auto& entry : _entitiesInScene) {
const auto& renderer = entry.second;
fadeOutRenderable(renderer);
}
} else {
qCWarning(entitiesrenderer) << "EntitityTreeRenderer::clear(), Unexpected null scene";
}
} }
_entitiesInScene.clear(); _entitiesInScene.clear();
_renderablesToUpdate.clear(); _renderablesToUpdate.clear();

View file

@ -7,6 +7,7 @@
// //
#include "RenderableWebEntityItem.h" #include "RenderableWebEntityItem.h"
#include <atomic>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLContext>
@ -46,7 +47,7 @@ static uint64_t MAX_NO_RENDER_INTERVAL = 30 * USECS_PER_SECOND;
static uint8_t YOUTUBE_MAX_FPS = 30; static uint8_t YOUTUBE_MAX_FPS = 30;
// Don't allow more than 20 concurrent web views // Don't allow more than 20 concurrent web views
static uint32_t _currentWebCount { 0 }; static std::atomic<uint32_t> _currentWebCount(0);
static const uint32_t MAX_CONCURRENT_WEB_VIEWS = 20; static const uint32_t MAX_CONCURRENT_WEB_VIEWS = 20;
static QTouchDevice _touchDevice; static QTouchDevice _touchDevice;
@ -356,16 +357,15 @@ void WebEntityRenderer::buildWebSurface(const EntityItemPointer& entity, const Q
void WebEntityRenderer::destroyWebSurface() { void WebEntityRenderer::destroyWebSurface() {
QSharedPointer<OffscreenQmlSurface> webSurface; QSharedPointer<OffscreenQmlSurface> webSurface;
ContentType contentType = ContentType::NoContent;
withWriteLock([&] { withWriteLock([&] {
webSurface.swap(_webSurface); webSurface.swap(_webSurface);
_contentType = contentType; _contentType = ContentType::NoContent;
});
if (webSurface) { if (webSurface) {
--_currentWebCount; --_currentWebCount;
WebEntityRenderer::releaseWebSurface(webSurface, _cachedWebSurface, _connections); WebEntityRenderer::releaseWebSurface(webSurface, _cachedWebSurface, _connections);
} }
});
} }
glm::vec2 WebEntityRenderer::getWindowSize(const TypedEntityPointer& entity) const { glm::vec2 WebEntityRenderer::getWindowSize(const TypedEntityPointer& entity) const {
@ -469,6 +469,12 @@ void WebEntityRenderer::handlePointerEventAsMouse(const PointerEvent& event) {
QCoreApplication::sendEvent(_webSurface->getWindow(), &mouseEvent); QCoreApplication::sendEvent(_webSurface->getWindow(), &mouseEvent);
} }
void WebEntityRenderer::onRemoveFromSceneTyped(const TypedEntityPointer& entity) {
// HACK: destroyWebSurface() here to avoid a crash on shutdown.
// TODO: fix the real problem: EntityRenderer<>::dtor never called on shutdown for smart-pointer resource leak.
destroyWebSurface();
}
void WebEntityRenderer::setProxyWindow(QWindow* proxyWindow) { void WebEntityRenderer::setProxyWindow(QWindow* proxyWindow) {
withReadLock([&] { withReadLock([&] {
if (_webSurface) { if (_webSurface) {

View file

@ -64,6 +64,7 @@ protected:
void handlePointerEventAsTouch(const PointerEvent& event); void handlePointerEventAsTouch(const PointerEvent& event);
void handlePointerEventAsMouse(const PointerEvent& event); void handlePointerEventAsMouse(const PointerEvent& event);
void onRemoveFromSceneTyped(const TypedEntityPointer& entity) override;
private: private:
void onTimeout(); void onTimeout();
void buildWebSurface(const EntityItemPointer& entity, const QString& newSourceURL); void buildWebSurface(const EntityItemPointer& entity, const QString& newSourceURL);

View file

@ -343,4 +343,4 @@ PulsePropertyGroup WebEntityItem::getPulseProperties() const {
return resultWithReadLock<PulsePropertyGroup>([&] { return resultWithReadLock<PulsePropertyGroup>([&] {
return _pulseProperties; return _pulseProperties;
}); });
} }