History

Fix DISABLE_QML behavior

Brad Davis committed 8 years ago

Commit d6bcdcd1 parent 243bd5e7 files · +73 −18Browse files

Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all

Unified · Split

interface/src/Application.cpp+8−5
@@ -4574,11 +4574,14 @@ void Application::idle() { · 4573 unmodified lines
45744574 _lastTimeUpdated.start();
45754575
45764576 // If the offscreen Ui has something active that is NOT the root, then assume it has keyboard focus.
4577− if (_keyboardDeviceHasFocus && offscreenUi && offscreenUi->getWindow()->activeFocusItem() != offscreenUi->getRootItem()) {
4578− _keyboardMouseDevice->pluginFocusOutEvent();
4579− _keyboardDeviceHasFocus = false;
4580− } else if (offscreenUi && offscreenUi->getWindow()->activeFocusItem() == offscreenUi->getRootItem()) {
4581− _keyboardDeviceHasFocus = true;
4577+ if (offscreenUi && offscreenUi->getWindow()) {
4578+ auto activeFocusItem = offscreenUi->getWindow()->activeFocusItem();
4579+ if (_keyboardDeviceHasFocus && activeFocusItem != offscreenUi->getRootItem()) {
4580+ _keyboardMouseDevice->pluginFocusOutEvent();
4581+ _keyboardDeviceHasFocus = false;
4582+ } else if (activeFocusItem == offscreenUi->getRootItem()) {
4583+ _keyboardDeviceHasFocus = true;
4584+ }
45824585 }
45834586
45844587 checkChangeCursor();