From b5d372ed4b9369019674551330920e71ab92ff8b Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 9 Mar 2026 18:31:01 +0800 Subject: [PATCH] Refactor AutoDropShadow logic for clarity and correctness Simplified the AutoDropShadow method to avoid redundant operations and improve readability. Now, window corner preference and drop shadow effects are set based on blur and backdrop support, with clear comments explaining each case. Removed convoluted branching for more direct logic. --- Flow.Launcher.Core/Resource/Theme.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index fb463b4d4c0..bcb7f268515 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -706,30 +706,27 @@ private void SetBlurForWindow(string theme, BackdropTypes backdropType) private void AutoDropShadow(bool useDropShadowEffect) { - SetWindowCornerPreference("Default"); - RemoveDropShadowEffectFromCurrentTheme(); if (useDropShadowEffect) { if (BlurEnabled && Win32Helper.IsBackdropSupported()) { + // For themes with blur enabled, the window border is rendered by the system, + // so we set corner preference to round and remove drop shadow effect to avoid rendering issues. SetWindowCornerPreference("Round"); + RemoveDropShadowEffectFromCurrentTheme(); } else { + // For themes without blur, we set corner preference to default and add drop shadow effect. SetWindowCornerPreference("Default"); AddDropShadowEffectToCurrentTheme(); } } else { - if (BlurEnabled && Win32Helper.IsBackdropSupported()) - { - SetWindowCornerPreference("Default"); - } - else - { - RemoveDropShadowEffectFromCurrentTheme(); - } + // When drop shadow effect is disabled, we set corner preference to default and remove drop shadow effect. + SetWindowCornerPreference("Default"); + RemoveDropShadowEffectFromCurrentTheme(); } }