Browse Source

Windows: Fixed a bug on later versions of Windows 10 causing the on-screen keyboard to keep showing and hiding

tags/2021-05-28
ed 6 years ago
parent
commit
8635315e61
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 18
- 1
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -1044,7 +1044,7 @@ private:
const ScopedValueSetter<bool> setter (reentrant, true, false);
const bool isActive = isVisible();
auto isActive = isKeyboardVisible();
if (isActive != shouldBeActive)
{
@@ -1061,6 +1061,14 @@ private:
}
bool isVisible()
{
if (auto hwnd = FindWindowEx (NULL, NULL, L"ApplicationFrameWindow", NULL))
return FindWindowEx (hwnd, NULL, L"Windows.UI.Core.CoreWindow", L"Microsoft Text Input Application") != NULL;
return false;
}
bool isVisibleLegacy()
{
if (auto hwnd = FindWindow (L"IPTip_Main_Window", NULL))
{
@@ -1071,6 +1079,15 @@ private:
return false;
}
bool isKeyboardVisible()
{
if (isVisible())
return true;
// isVisible() may fail on Win10 versions < 1709 so try the old method too
return isVisibleLegacy();
}
bool shouldBeActive = false, reentrant = false;
ComSmartPtr<ITipInvocation> tipInvocation;
};


Loading…
Cancel
Save