Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -4979,6 +4979,15 @@ void Application::idle() { · 4978 unmodified lines | ||
| 4979 | 4979 | } |
| 4980 | 4980 | } |
| 4981 | 4981 | |
| 4982 | + { | |
| 4983 | + if (_keyboardFocusWaitingOnRenderable && getEntities()->renderableForEntityId(_keyboardFocusedEntity.get())) { | |
| 4984 | + _keyboardFocusWaitingOnRenderable = false; | |
| 4985 | + QUuid entityId = _keyboardFocusedEntity.get(); | |
| 4986 | + setKeyboardFocusEntity(UNKNOWN_ENTITY_ID); | |
| 4987 | + setKeyboardFocusEntity(entityId); | |
| 4988 | + } | |
| 4989 | + } | |
| 4990 | + | |
| 4982 | 4991 | { |
| 4983 | 4992 | PerformanceTimer perfTimer("pluginIdle"); |
| 4984 | 4993 | PerformanceWarning warn(showWarnings, "Application::idle()... pluginIdle()"); |
| @@ -5807,7 +5816,7 @@ void Application::setKeyboardFocusEntity(const QUuid& id) { · 822 unmodified lines | ||
| 5807 | 5816 | if (qApp->getLoginDialogPoppedUp() && !_loginDialogID.isNull()) { |
| 5808 | 5817 | if (id == _loginDialogID) { |
| 5809 | 5818 | emit loginDialogFocusEnabled(); |
| 5810 | − } else { | |
| 5819 | + } else if (!_keyboardFocusWaitingOnRenderable) { | |
| 5811 | 5820 | // that's the only entity we want in focus; |
| 5812 | 5821 | return; |
| 5813 | 5822 | } |
| @@ -5824,7 +5833,10 @@ void Application::setKeyboardFocusEntity(const QUuid& id) { · 10 unmodified lines | ||
| 5824 | 5833 | if (properties.getVisible()) { |
| 5825 | 5834 | auto entities = getEntities(); |
| 5826 | 5835 | auto entityId = _keyboardFocusedEntity.get(); |
| 5827 | − if (entities->wantsKeyboardFocus(entityId)) { | |
| 5836 | + auto entityItemRenderable = entities->renderableForEntityId(entityId); | |
| 5837 | + if (!entityItemRenderable) { | |
| 5838 | + _keyboardFocusWaitingOnRenderable = true; | |
| 5839 | + } else if (entityItemRenderable->wantsKeyboardFocus()) { | |
| 5828 | 5840 | entities->setProxyWindow(entityId, _window->windowHandle()); |
| 5829 | 5841 | if (_keyboardMouseDevice->isActive()) { |
| 5830 | 5842 | _keyboardMouseDevice->pluginFocusOutEvent(); |