diff options
author | Bastien Bouclet | 2017-11-28 05:48:01 +0100 |
---|---|---|
committer | Bastien Bouclet | 2017-11-28 05:49:45 +0100 |
commit | 6eb9a48bbddf8912c149da2bbe58b343cbd8a6bc (patch) | |
tree | d710e402860506375eaacea4e7430280a62569eb /backends/events | |
parent | c278677d07e855071bb64d7005594db94ac1a103 (diff) | |
download | scummvm-rg350-6eb9a48bbddf8912c149da2bbe58b343cbd8a6bc.tar.gz scummvm-rg350-6eb9a48bbddf8912c149da2bbe58b343cbd8a6bc.tar.bz2 scummvm-rg350-6eb9a48bbddf8912c149da2bbe58b343cbd8a6bc.zip |
EVENTS: Delay initializing the virtual keyboard
The virtual keyboard requires the backend to be fully initialized
because it needs the display size.
Fixes #10338.
Diffstat (limited to 'backends/events')
-rw-r--r-- | backends/events/default/default-events.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 8dd9599d20..85cf44c960 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -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); @@ -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 { @@ -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 { |