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 | PerformanceTimer perfTimer("pluginIdle"); | 4992 | PerformanceTimer perfTimer("pluginIdle"); |
| 4984 | PerformanceWarning warn(showWarnings, "Application::idle()... pluginIdle()"); | 4993 | PerformanceWarning warn(showWarnings, "Application::idle()... pluginIdle()"); |
| @@ -5807,7 +5816,7 @@ void Application::setKeyboardFocusEntity(const QUuid& id) { · 822 unmodified lines | |||
| 5807 | if (qApp->getLoginDialogPoppedUp() && !_loginDialogID.isNull()) { | 5816 | if (qApp->getLoginDialogPoppedUp() && !_loginDialogID.isNull()) { |
| 5808 | if (id == _loginDialogID) { | 5817 | if (id == _loginDialogID) { |
| 5809 | emit loginDialogFocusEnabled(); | 5818 | emit loginDialogFocusEnabled(); |
| 5810 | } else { | 5819 | } else if (!_keyboardFocusWaitingOnRenderable) { |
| 5811 | // that's the only entity we want in focus; | 5820 | // that's the only entity we want in focus; |
| 5812 | return; | 5821 | return; |
| 5813 | } | 5822 | } |
| @@ -5824,7 +5833,10 @@ void Application::setKeyboardFocusEntity(const QUuid& id) { · 10 unmodified lines | |||
| 5824 | if (properties.getVisible()) { | 5833 | if (properties.getVisible()) { |
| 5825 | auto entities = getEntities(); | 5834 | auto entities = getEntities(); |
| 5826 | auto entityId = _keyboardFocusedEntity.get(); | 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 | entities->setProxyWindow(entityId, _window->windowHandle()); | 5840 | entities->setProxyWindow(entityId, _window->windowHandle()); |
| 5829 | if (_keyboardMouseDevice->isActive()) { | 5841 | if (_keyboardMouseDevice->isActive()) { |
| 5830 | _keyboardMouseDevice->pluginFocusOutEvent(); | 5842 | _keyboardMouseDevice->pluginFocusOutEvent(); |