Skip to content

Commit 24b4e03

Browse files
authored
Merge pull request #4330 from Flow-Launcher/AutoDropShadow
Refactor AutoDropShadow logic for clarity and correctness
2 parents ed85bb2 + b5d372e commit 24b4e03

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -702,30 +702,27 @@ private void SetBlurForWindow(string theme, BackdropTypes backdropType)
702702

703703
private void AutoDropShadow(bool useDropShadowEffect)
704704
{
705-
SetWindowCornerPreference("Default");
706-
RemoveDropShadowEffectFromCurrentTheme();
707705
if (useDropShadowEffect)
708706
{
709707
if (BlurEnabled && Win32Helper.IsBackdropSupported())
710708
{
709+
// For themes with blur enabled, the window border is rendered by the system,
710+
// so we set corner preference to round and remove drop shadow effect to avoid rendering issues.
711711
SetWindowCornerPreference("Round");
712+
RemoveDropShadowEffectFromCurrentTheme();
712713
}
713714
else
714715
{
716+
// For themes without blur, we set corner preference to default and add drop shadow effect.
715717
SetWindowCornerPreference("Default");
716718
AddDropShadowEffectToCurrentTheme();
717719
}
718720
}
719721
else
720722
{
721-
if (BlurEnabled && Win32Helper.IsBackdropSupported())
722-
{
723-
SetWindowCornerPreference("Default");
724-
}
725-
else
726-
{
727-
RemoveDropShadowEffectFromCurrentTheme();
728-
}
723+
// When drop shadow effect is disabled, we set corner preference to default and remove drop shadow effect.
724+
SetWindowCornerPreference("Default");
725+
RemoveDropShadowEffectFromCurrentTheme();
729726
}
730727
}
731728

0 commit comments

Comments
 (0)