mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fixed a bug on later versions of Windows 10 causing the on-screen keyboard to keep showing and hiding
This commit is contained in:
parent
f0c1c4c6f5
commit
8635315e61
1 changed files with 18 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue