From 7aa4696ba513d4af0c411bd4ebbe4a1a33560399 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Mon, 27 May 2024 22:11:38 +0800 Subject: [PATCH] drop else --- .../Core/Windowing/XamlWindowController.cs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Windowing/XamlWindowController.cs b/src/Snap.Hutao/Snap.Hutao/Core/Windowing/XamlWindowController.cs index 512b0c69..a78cf106 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/Windowing/XamlWindowController.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/Windowing/XamlWindowController.cs @@ -140,19 +140,17 @@ internal sealed class XamlWindowController RECT primaryRect = StructMarshal.RECT(DisplayArea.Primary.OuterBounds); return IntersectRect(out _, in primaryRect, in iconRect); } - else + + HWND shellTrayWnd = FindWindowExW(default, default, "Shell_TrayWnd", default); + HWND trayNotifyWnd = FindWindowExW(shellTrayWnd, default, "TrayNotifyWnd", default); + HWND button = FindWindowExW(trayNotifyWnd, default, "Button", default); + + if (GetWindowRect(button, out RECT buttonRect)) { - HWND shellTrayWnd = FindWindowExW(default, default, "Shell_TrayWnd", default); - HWND trayNotifyWnd = FindWindowExW(shellTrayWnd, default, "TrayNotifyWnd", default); - HWND button = FindWindowExW(trayNotifyWnd, default, "Button", default); - - if (GetWindowRect(button, out RECT buttonRect)) - { - return !EqualRect(in buttonRect, in iconRect); - } - - return false; + return !EqualRect(in buttonRect, in iconRect); } + + return false; } #region SystemBackdrop & ElementTheme