From 9fe0309ae65d0ae2d42a48e43812935ebab6a752 Mon Sep 17 00:00:00 2001 From: danteruiz Date: Thu, 28 Feb 2019 17:11:48 -0800 Subject: [PATCH] another login fix --- interface/src/Application.cpp | 8 +++++--- interface/src/Application.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ebc1176ee1..274d6919af 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4980,10 +4980,11 @@ void Application::idle() { } { - if (_keyboardFocusWaitingOnRenderable && getEntities()->renderableForEntityId(_keyboardFocusedEntity.get())) { - _keyboardFocusWaitingOnRenderable = false; - QUuid entityId = _keyboardFocusedEntity.get(); + if (_keyboardFocusWaitingOnRenderable && getEntities()->renderableForEntityId(_entityIdWaitingOnRenderable.get())) { + QUuid entityId = _entityIdWaitingOnRenderable.get(); + _entityIdWaitingOnRenderable.set(UNKNOWN_ENTITY_ID); setKeyboardFocusEntity(UNKNOWN_ENTITY_ID); + _keyboardFocusWaitingOnRenderable = false; setKeyboardFocusEntity(entityId); } } @@ -5836,6 +5837,7 @@ void Application::setKeyboardFocusEntity(const QUuid& id) { auto entityItemRenderable = entities->renderableForEntityId(entityId); if (!entityItemRenderable) { _keyboardFocusWaitingOnRenderable = true; + _entityIdWaitingOnRenderable.set(id); } else if (entityItemRenderable->wantsKeyboardFocus()) { entities->setProxyWindow(entityId, _window->windowHandle()); if (_keyboardMouseDevice->isActive()) { diff --git a/interface/src/Application.h b/interface/src/Application.h index c16f260192..5e3090973a 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -733,6 +733,7 @@ private: bool _reticleClickPressed { false }; bool _keyboardFocusWaitingOnRenderable { false }; + ThreadSafeValueCache _entityIdWaitingOnRenderable; int _avatarAttachmentRequest = 0;