From 5bb4539e3f2d04288bf52164fdbf47bcaf949aea Mon Sep 17 00:00:00 2001 From: Undo <66901840+AntarcticBruin@users.noreply.github.com> Date: Thu, 11 Dec 2025 12:02:05 +0800 Subject: [PATCH] fix(window): hover effect of the minimize and close button does not disappear (#5786) * fix(window): hover effect of the minimize and close button does not disappear * docs: add necessary comments --------- Co-authored-by: Sline --- src/providers/window-provider.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/providers/window-provider.tsx b/src/providers/window-provider.tsx index 3cc930e77..8bc8aaa12 100644 --- a/src/providers/window-provider.tsx +++ b/src/providers/window-provider.tsx @@ -80,8 +80,15 @@ export const WindowProvider = ({ children }: PropsWithChildren) => { }; return { - minimize: () => currentWindow.minimize(), - close: () => currentWindow.close(), + minimize: async () => { + // Delay one frame so the UI can clear :hover before the window hides. + await new Promise((resolve) => setTimeout(resolve, 10)); + await currentWindow.minimize(); + }, + close: async () => { + await new Promise((resolve) => setTimeout(resolve, 20)); + await currentWindow.close(); + }, refreshDecorated, toggleDecorations, toggleMaximize,