History

Application: change keyboard input focus when using ui overlay.

call focusOutEvent on keyboard input plugin when an offscreen ui has activeFocus.

Anthony J. Thibault committed 10 years ago

Commit 07ff6871 parent 7c6c75c2 files · +11 −0Browse files

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

Unified · Split

interface/src/Application.cpp+9−0
@@ -2564,6 +2564,15 @@ void Application::idle(uint64_t now) { · 2563 unmodified lines
2564 _overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));2564 _overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));
2565 }2565 }
2566 2566
2567 // If the offscreen Ui has something active that is NOT the root, then assume it has keyboard focus.
2568 auto offscreenUi = DependencyManager::get<OffscreenUi>();
2569 if (_keyboardDeviceHasFocus && offscreenUi && offscreenUi->getWindow()->activeFocusItem() != offscreenUi->getRootItem()) {
2570 _keyboardMouseDevice->pluginFocusOutEvent();
2571 _keyboardDeviceHasFocus = false;
2572 } else if (offscreenUi && offscreenUi->getWindow()->activeFocusItem() == offscreenUi->getRootItem()) {
2573 _keyboardDeviceHasFocus = true;
2574 }
2575
2567 auto displayPlugin = getActiveDisplayPlugin();2576 auto displayPlugin = getActiveDisplayPlugin();
2568 // depending on whether we're throttling or not.2577 // depending on whether we're throttling or not.
2569 // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in2578 // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in