summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsinputcontext.h
diff options
context:
space:
mode:
authorAndre de la Rocha <andre.rocha@qt.io>2018-06-20 18:50:07 +0200
committerAndre de la Rocha <andre.rocha@qt.io>2018-06-28 09:28:57 +0000
commit3d867b84a3ac4c2b32b7d476eaeadc2c7fae277b (patch)
tree4fe08abf12d5308c9435031c21e2baa7fcf4a712 /src/plugins/platforms/windows/qwindowsinputcontext.h
parent023a818738d64da01ebecc5d4a26356055ba0021 (diff)
Fix automatic showing/hiding of the Windows 10 on-screen keyboard
The automatic showing/hiding of the built-in on-screen keyboard in touchscreen-based Windows computers, like the Microsoft Surface line, has stopped working after recent Windows updates. The OSK no longer seems to rely on UI Automation properties to detect text widgets. However, it can be triggered by showing an invisible caret. Task-number: QTBUG-68808 Change-Id: Ia604d21e314965dcdc61f1ced050cc3ed771f567 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsinputcontext.h')
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h
index ada1fc0d29..d647628ff1 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.h
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.h
@@ -58,12 +58,10 @@ class QWindowsInputContext : public QPlatformInputContext
struct CompositionContext
{
HWND hwnd = 0;
- bool haveCaret = false;
QString composition;
int position = 0;
bool isComposing = false;
QPointer<QObject> focusObject;
- qreal factor = 1;
};
public:
explicit QWindowsInputContext();
@@ -81,6 +79,8 @@ public:
QRectF keyboardRect() const override;
bool isInputPanelVisible() const override;
+ void showInputPanel() override;
+ void hideInputPanel() override;
bool startComposition(HWND hwnd);
bool composition(HWND hwnd, LPARAM lParam);
@@ -96,7 +96,7 @@ private slots:
void cursorRectChanged();
private:
- void initContext(HWND hwnd, qreal factor, QObject *focusObject);
+ void initContext(HWND hwnd, QObject *focusObject);
void doneContext();
void startContextComposition();
void endContextComposition();
@@ -104,7 +104,8 @@ private:
HWND getVirtualKeyboardWindowHandle() const;
const DWORD m_WM_MSIME_MOUSE;
- static HIMC m_defaultContext;
+ bool m_caretCreated = false;
+ HBITMAP m_transparentBitmap;
CompositionContext m_compositionContext;
bool m_endCompositionRecursionGuard = false;
LCID m_languageId;