aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-02-06 21:21:46 +0200
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-03-20 11:29:23 +0200
commit3c07e5febb430c2689a63ff18686ee37f3effdd0 (patch)
treeab344eed07207b55097fc05433a4bae88b6d4c42 /src
parentaef258a07f9e81c369106bad5f98b94871502185 (diff)
Fix collapsed keyboard layout caused by zero width input panel
This patch fixes the problem by delaying the loading of the layout until the keyboard width is valid. An additional updateInputMethod call is necessary, as the input method is dependent on the keyboard layout. However, this should only be called if the inputMethod is not set. This can occur with DesktopInputPanel. Furthermore, the restoreMode has been removed from the keyboard layout binding, as the keyboard layout should not be reset. Pick-to: 6.5 Fixes: QTBUG-111928 Change-Id: I94aae3dc978e3c0445edd2d55fcae233a43d581a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Inho Lee <inho.lee@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/components/Keyboard.qml16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/components/Keyboard.qml b/src/components/Keyboard.qml
index ad28ae8e..df3f8729 100644
--- a/src/components/Keyboard.qml
+++ b/src/components/Keyboard.qml
@@ -878,16 +878,22 @@ Item {
target: keyboardLayoutLoader
property: "source"
value: keyboard.layout
- when: keyboard.layout.length > 0
- restoreMode: Binding.RestoreBinding
+ when: keyboard.width > 0 && keyboard.layout.length > 0
+ restoreMode: Binding.RestoreNone
}
onItemChanged: {
+ if (!item)
+ return
+
// Reset input mode if the new layout wants to override it
- if (item && item.inputMode !== -1)
+ if (item.inputMode !== -1)
inputModeNeedsReset = true
- if (item)
- notifyLayoutChanged()
+
+ if (!InputContext.inputEngine.inputMethod)
+ updateInputMethod()
+
+ notifyLayoutChanged()
}
MultiPointTouchArea {