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
25642564 _overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));
25652565 }
25662566
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+
25672576 auto displayPlugin = getActiveDisplayPlugin();
25682577 // depending on whether we're throttling or not.
25692578 // Once rendering is off on another thread we should be able to have Application::idle run at start(0) in