aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-09-04 13:05:22 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-09-05 12:31:12 +0000
commitd781f8a6b867980e03ef42b792404285ea9a799e (patch)
tree665c2f168e07b148fe2f9d8c165f7fafbbeaf1ff
parent30479f9771e60938dc0f6e325e3b16fb52663796 (diff)
Partially revert 30479f9771e60938dc0f6e325e3b16fb52663796
With the 30479f9771e60938dc0f6e325e3b16fb52663796 patch applied it would mean that the keyboard would not show up in desktop mode. Therefore the patch is partially reverted to still have the original crash fix without introducing a new bug. Change-Id: I1a0c84eef0a592990ccd7ff754069ad150dc7a69 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/virtualkeyboard/platforminputcontext.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/virtualkeyboard/platforminputcontext.cpp b/src/virtualkeyboard/platforminputcontext.cpp
index 8b5ce99b..9980ff17 100644
--- a/src/virtualkeyboard/platforminputcontext.cpp
+++ b/src/virtualkeyboard/platforminputcontext.cpp
@@ -84,17 +84,19 @@ void PlatformInputContext::commit()
void PlatformInputContext::update(Qt::InputMethodQueries queries)
{
VIRTUALKEYBOARD_DEBUG() << "PlatformInputContext::update():" << queries;
- if (m_inputContext) {
- bool enabled = inputMethodQuery(Qt::ImEnabled).toBool();
- if (enabled) {
+ bool enabled = inputMethodQuery(Qt::ImEnabled).toBool();
#ifdef QT_VIRTUALKEYBOARD_DESKTOP
- if (!m_inputPanel) {
- m_inputPanel = new DesktopInputPanel(this);
- m_inputPanel->createView();
- m_selectionControl = new DesktopInputSelectionControl(this, m_inputContext);
- m_selectionControl->createHandles();
- }
+ if (enabled && !m_inputPanel) {
+ m_inputPanel = new DesktopInputPanel(this);
+ m_inputPanel->createView();
+ if (m_inputContext) {
+ m_selectionControl = new DesktopInputSelectionControl(this, m_inputContext);
+ m_selectionControl->createHandles();
+ }
+ }
#endif
+ if (m_inputContext) {
+ if (enabled) {
m_inputContext->update(queries);
if (m_visible)
updateInputPanelVisible();