diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index c13fb5c0be7..48543c9c6f2 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -59,6 +59,7 @@ public static void InitSystemLanguageCode() string.Equals(languageCode, fullName, StringComparison.OrdinalIgnoreCase)) { SystemLanguageCode = languageCode; + return; } } diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index feafcfcdaa0..8993caf5266 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -292,18 +292,27 @@ public static unsafe bool IsForegroundWindowFullscreen() return appBounds.top < 0 && appBounds.bottom < 0; } - // For desktop (Progman or WorkerW, depends on the system), we have to check + // For desktop (Progman or WorkerW, depends on the system), + // we have to check for this hierarchy: + // Progman/WorkerW -> SHELLDLL_DefView -> SysListView32("FolderView") if (windowClass is WINDOW_CLASS_PROGMAN or WINDOW_CLASS_WORKERW) { - var hWndDesktop = PInvoke.FindWindowEx(hWnd, HWND.Null, "SHELLDLL_DefView", null); - hWndDesktop = PInvoke.FindWindowEx(hWndDesktop, HWND.Null, "SysListView32", "FolderView"); - if (hWndDesktop != HWND.Null) + var hWndDefView = PInvoke.FindWindowEx(hWnd, HWND.Null, "SHELLDLL_DefView", null); + if (hWndDefView != HWND.Null) { - return false; + var hWndFolderView = PInvoke.FindWindowEx(hWndDefView, HWND.Null, "SysListView32", "FolderView"); + if (hWndFolderView != HWND.Null) + { + return false; + } } } var monitorInfo = MonitorInfo.GetNearestDisplayMonitor(hWnd); + if (monitorInfo == null) + { + return false; + } return (appBounds.bottom - appBounds.top) == monitorInfo.Bounds.Height && (appBounds.right - appBounds.left) == monitorInfo.Bounds.Width; }