Skip to content

Commit

Permalink
EVENTS: Delay initializing the virtual keyboard
Browse files Browse the repository at this point in the history
The virtual keyboard requires the backend to be fully initialized
because it needs the display size.

Fixes #10338.
  • Loading branch information
bgK committed Nov 28, 2017
1 parent c278677 commit 6eb9a48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backends/events/default/default-events.cpp
Expand Up @@ -54,7 +54,7 @@ DefaultEventManager::DefaultEventManager(Common::EventSource *boss) :
_keyRepeatTime = 0;

#ifdef ENABLE_VKEYBD
_vk = new Common::VirtualKeyboard();
_vk = nullptr;
#endif
#ifdef ENABLE_KEYMAPPER
_keymapper = new Common::Keymapper(this);
Expand All @@ -74,6 +74,8 @@ DefaultEventManager::~DefaultEventManager() {

void DefaultEventManager::init() {
#ifdef ENABLE_VKEYBD
_vk = new Common::VirtualKeyboard();

if (ConfMan.hasKey("vkeybd_pack_name")) {
_vk->loadKeyboardPack(ConfMan.get("vkeybd_pack_name"));
} else {
Expand Down Expand Up @@ -152,6 +154,9 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
break;
#ifdef ENABLE_VKEYBD
case Common::EVENT_VIRTUAL_KEYBOARD:
if (!_vk)
break;

if (_vk->isDisplaying()) {
_vk->close(true);
} else {
Expand Down

0 comments on commit 6eb9a48

Please sign in to comment.