From b2318cfeab35f0a0cdde496519ad94f48548ecc8 Mon Sep 17 00:00:00 2001 From: Sylphera <233718609+Sylphera@users.noreply.github.com> Date: Sun, 22 Nov 2026 22:11:02 +0100 Subject: [PATCH 1/2] Stop forwarding close requests from the tray hook to Explorer --- src/windows/services/systray/hook.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/windows/services/systray/hook.cpp b/src/windows/services/systray/hook.cpp index 51123d76f..40cd424be 100644 --- a/src/windows/services/systray/hook.cpp +++ b/src/windows/services/systray/hook.cpp @@ -396,7 +396,10 @@ LRESULT HookWindow::handle(UINT msg, WPARAM wParam, LPARAM lParam) { return 0; } - return this->forward(msg, wParam, lParam).value_or(0); + // Never forward: a close sent to the taskbar makes Explorer open its + // "Shut Down Windows" dialog. Task Scheduler sends WM_CLOSE to every + // window of the shell when it stops it, so each restart showed it. + return 0; case WM_DESTROY: KillTimer(this->hwnd, RAISE_TIMER); KillTimer(this->hwnd, ANNOUNCE_TIMER); From 380207e31affce654d051b55488c2f57fc4ffdfc Mon Sep 17 00:00:00 2001 From: Sylphera <233718609+Sylphera@users.noreply.github.com> Date: Sun, 22 Nov 2026 22:37:45 +0100 Subject: [PATCH 2/2] Remove explanatory comments introduced by Windows port changes --- src/windows/services/systray/hook.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/windows/services/systray/hook.cpp b/src/windows/services/systray/hook.cpp index 40cd424be..a6eeb1593 100644 --- a/src/windows/services/systray/hook.cpp +++ b/src/windows/services/systray/hook.cpp @@ -396,9 +396,6 @@ LRESULT HookWindow::handle(UINT msg, WPARAM wParam, LPARAM lParam) { return 0; } - // Never forward: a close sent to the taskbar makes Explorer open its - // "Shut Down Windows" dialog. Task Scheduler sends WM_CLOSE to every - // window of the shell when it stops it, so each restart showed it. return 0; case WM_DESTROY: KillTimer(this->hwnd, RAISE_TIMER);