fixing login dialog

This commit is contained in:
danteruiz 2019-02-26 15:37:31 -08:00
parent 92168f60c6
commit 2fd94c6bbc
2 changed files with 15 additions and 2 deletions

View file

@ -4979,6 +4979,15 @@ void Application::idle() {
} }
} }
{
if (_keyboardFocusWaitingOnRenderable && getEntities()->renderableForEntityId(_keyboardFocusedEntity.get())) {
_keyboardFocusWaitingOnRenderable = false;
QUuid entityId = _keyboardFocusedEntity.get();
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
setKeyboardFocusEntity(entityId);
}
}
{ {
PerformanceTimer perfTimer("pluginIdle"); PerformanceTimer perfTimer("pluginIdle");
PerformanceWarning warn(showWarnings, "Application::idle()... pluginIdle()"); PerformanceWarning warn(showWarnings, "Application::idle()... pluginIdle()");
@ -5807,7 +5816,7 @@ void Application::setKeyboardFocusEntity(const QUuid& id) {
if (qApp->getLoginDialogPoppedUp() && !_loginDialogID.isNull()) { if (qApp->getLoginDialogPoppedUp() && !_loginDialogID.isNull()) {
if (id == _loginDialogID) { if (id == _loginDialogID) {
emit loginDialogFocusEnabled(); emit loginDialogFocusEnabled();
} else { } else if (!_keyboardFocusWaitingOnRenderable) {
// that's the only entity we want in focus; // that's the only entity we want in focus;
return; return;
} }
@ -5824,7 +5833,10 @@ void Application::setKeyboardFocusEntity(const QUuid& id) {
if (properties.getVisible()) { if (properties.getVisible()) {
auto entities = getEntities(); auto entities = getEntities();
auto entityId = _keyboardFocusedEntity.get(); auto entityId = _keyboardFocusedEntity.get();
if (entities->wantsKeyboardFocus(entityId)) { auto entityItemRenderable = entities->renderableForEntityId(entityId);
if (!entityItemRenderable) {
_keyboardFocusWaitingOnRenderable = true;
} else if (entityItemRenderable->wantsKeyboardFocus()) {
entities->setProxyWindow(entityId, _window->windowHandle()); entities->setProxyWindow(entityId, _window->windowHandle());
if (_keyboardMouseDevice->isActive()) { if (_keyboardMouseDevice->isActive()) {
_keyboardMouseDevice->pluginFocusOutEvent(); _keyboardMouseDevice->pluginFocusOutEvent();

View file

@ -732,6 +732,7 @@ private:
bool _failedToConnectToEntityServer { false }; bool _failedToConnectToEntityServer { false };
bool _reticleClickPressed { false }; bool _reticleClickPressed { false };
bool _keyboardFocusWaitingOnRenderable { false };
int _avatarAttachmentRequest = 0; int _avatarAttachmentRequest = 0;