mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 12:24:29 +02:00
Application: change keyboard input focus when using ui overlay.
call focusOutEvent on keyboard input plugin when an offscreen ui has activeFocus.
This commit is contained in:
parent
7c6c75c484
commit
07ff687bfe
2 changed files with 11 additions and 0 deletions
|
@ -2564,6 +2564,15 @@ void Application::idle(uint64_t now) {
|
||||||
_overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));
|
_overlayConductor.setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Overlays));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the offscreen Ui has something active that is NOT the root, then assume it has keyboard focus.
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
if (_keyboardDeviceHasFocus && offscreenUi && offscreenUi->getWindow()->activeFocusItem() != offscreenUi->getRootItem()) {
|
||||||
|
_keyboardMouseDevice->pluginFocusOutEvent();
|
||||||
|
_keyboardDeviceHasFocus = false;
|
||||||
|
} else if (offscreenUi && offscreenUi->getWindow()->activeFocusItem() == offscreenUi->getRootItem()) {
|
||||||
|
_keyboardDeviceHasFocus = true;
|
||||||
|
}
|
||||||
|
|
||||||
auto displayPlugin = getActiveDisplayPlugin();
|
auto displayPlugin = getActiveDisplayPlugin();
|
||||||
// depending on whether we're throttling or not.
|
// depending on whether we're throttling or not.
|
||||||
// Once rendering is off on another thread we should be able to have Application::idle run at start(0) in
|
// Once rendering is off on another thread we should be able to have Application::idle run at start(0) in
|
||||||
|
|
|
@ -518,6 +518,8 @@ private:
|
||||||
std::mutex _preRenderLambdasLock;
|
std::mutex _preRenderLambdasLock;
|
||||||
|
|
||||||
std::atomic<uint32_t> _processOctreeStatsCounter { 0 };
|
std::atomic<uint32_t> _processOctreeStatsCounter { 0 };
|
||||||
|
|
||||||
|
bool _keyboardDeviceHasFocus { true };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Application_h
|
#endif // hifi_Application_h
|
||||||
|
|
Loading…
Reference in a new issue