aboutsummaryrefslogtreecommitdiffstats
path: root/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-03-02 17:20:53 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-03-03 12:38:21 +0100
commit95be4f1e3945f88adc9d55fa06371665254a1127 (patch)
tree3739dba70ca65db8afd8efebd23cc572e712dc97 /src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
parent4e8b3dd45ae4cc66a1b77cce901f80406b2a0f69 (diff)
Refactor desktop-detection logic to become an explicit propertyv5.15.0-beta2
The __isRootPanel internal property was used to detect whether the keyboard is running in as a stand-alone, toplevel window in the desktop. The value of the property depended on the location of the keyboard panel within the QQuickItem hierarchy, which is fragile. Instead, declare an explicit property desktopPanel that is set to true by the desktop integration when the panel has been created. Change-Id: Idb9e90e01e9b1c643e84287716e0b964256b115e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp')
-rw-r--r--src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp b/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
index 2c945356..a7c0aad9 100644
--- a/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
+++ b/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
@@ -273,15 +273,13 @@ void QVirtualKeyboardInputContextPrivate::onInputItemChanged()
if (QObject *item = inputItem()) {
if (QQuickItem *vkbPanel = qobject_cast<QQuickItem*>(inputPanel)) {
if (QQuickItem *quickItem = qobject_cast<QQuickItem*>(item)) {
- const QVariant isRootItem = vkbPanel->property("__isRootItem");
+ const QVariant isDesktopPanel = vkbPanel->property("desktopPanel");
/*
For integrated keyboards, make sure it's a sibling to the overlay. The
high z-order will make sure it gets events also during a modal session.
*/
- if (isRootItem.isValid() && !isRootItem.toBool()) {
+ if (isDesktopPanel.isValid() && !isDesktopPanel.toBool())
vkbPanel->setParentItem(quickItem->window()->contentItem());
- vkbPanel->setProperty("__reparented", true);
- }
}
}
} else {