From cc873ec23a98ac32d10ac5fa569792fde2f6b2c8 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Wed, 3 Jul 2019 18:20:17 +0200 Subject: Windows QPA: Fix blinking dot on Windows 7/8/8.1 A blinking white dot could appear on dark backgrounds on Windows 7/8/8.1. It was caused by a workaround added to trigger the on-screen keyboard on the Microsoft Surface. This change effectively restricts that workaround to Windows 10, where the blinking dot was not an issue. And anyway, impact over the Surface functionality should be minimal, as all models produced since 2015 only support Windows 10 (and it's unknown if the workaround was ever necessary for early models running Windows 8.1). Fixes: QTBUG-74492 Change-Id: Ic9b9c0f71f23b75212054c56a29796cf0efa109a Reviewed-by: Volker Hilsheimer Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsinputcontext.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index 8adcf56b11..61f971143d 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -279,7 +280,13 @@ void QWindowsInputContext::showInputPanel() // with Windows 10 if the Windows IME is (re)enabled _after_ the caret is shown. if (m_caretCreated) { cursorRectChanged(); - ShowCaret(platformWindow->handle()); + // We only call ShowCaret() on Windows 10 as in earlier versions the caret + // would actually be visible (QTBUG-74492) and the workaround for the + // Surface seems unnecessary there anyway. But leave it hidden for IME. + if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10) + ShowCaret(platformWindow->handle()); + else + HideCaret(platformWindow->handle()); setWindowsImeEnabled(platformWindow, false); setWindowsImeEnabled(platformWindow, true); } -- cgit v1.2.3