Skip to content

Commit 218635a

Browse files
committed
Add logic to check whether the Korean IME is in use
1 parent c5f2fca commit 218635a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public static class Win32Helper
2121
{
2222
#region Blur Handling
2323

24+
public static bool IsWindows11()
25+
{
26+
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000;
27+
}
2428
public static bool IsBackdropSupported()
2529
{
2630
// Mica and Acrylic only supported Windows 11 22000+

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Linq;
34
using System.Windows.Forms;
45
using CommunityToolkit.Mvvm.Input;
56
using Flow.Launcher.Core;
@@ -205,7 +206,18 @@ public bool LegacyKoreanIMEEnabled
205206
}
206207
}
207208

208-
public bool KoreanIMERegistryKeyExists => Win32Helper.IsKoreanIMEExist();
209+
public bool KoreanIMERegistryKeyExists
210+
{
211+
get
212+
{
213+
bool registryKeyExists = Win32Helper.IsKoreanIMEExist();
214+
bool koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast<InputLanguage>().Any(lang => lang.Culture.Name.StartsWith("ko"));
215+
bool isWindows11 = Win32Helper.IsWindows11();
216+
217+
// Return true if Windows 11 with Korean IME installed, or if the registry key exists
218+
return (isWindows11 && koreanLanguageInstalled) || registryKeyExists;
219+
}
220+
}
209221

210222
public bool KoreanIMERegistryValueIsZero
211223
{

0 commit comments

Comments
 (0)