From 5dc91088d1e2a554780a881e7f18f5c1aebb229c Mon Sep 17 00:00:00 2001 From: SakuraStar Date: Sun, 19 Apr 2026 12:42:53 +0800 Subject: [PATCH 1/2] fix: prevent full-screen overlay from triggering Windows Do Not Disturb mode --- src/MainWindow.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MainWindow.xaml.cs b/src/MainWindow.xaml.cs index 41569dd..cc4c2b5 100644 --- a/src/MainWindow.xaml.cs +++ b/src/MainWindow.xaml.cs @@ -108,6 +108,7 @@ private struct MONITORINFO private const int WS_EX_TRANSPARENT = 0x00000020; private const int WS_EX_LAYERED = 0x00080000; private const int WS_EX_TOOLWINDOW = 0x00000080; + private const int WS_EX_NOACTIVATE = 0x08000000; private const Int32 CURSOR_SHOWING = 0x00000001; // 光标可见状态码 private const int SM_XVIRTUALSCREEN = 76; @@ -165,7 +166,7 @@ protected override void OnSourceInitialized(EventArgs e) base.OnSourceInitialized(e); _hwnd = new WindowInteropHelper(this).Handle; int style = GetWindowLong(_hwnd, GWL_EXSTYLE); - SetWindowLong(_hwnd, GWL_EXSTYLE, style | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW); + SetWindowLong(_hwnd, GWL_EXSTYLE, style | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE); UpdateOverlayBounds(); SystemEvents.DisplaySettingsChanged += HandleDisplaySettingsChanged; From 0ef9fab4a3f79c33cfc49771db284827078fe76e Mon Sep 17 00:00:00 2001 From: SakuraStar Date: Sun, 19 Apr 2026 12:45:16 +0800 Subject: [PATCH 2/2] fix: apply 1-pixel height offset to prevent triggering Windows Do Not Disturb mode --- src/MainWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MainWindow.xaml.cs b/src/MainWindow.xaml.cs index cc4c2b5..fc72a22 100644 --- a/src/MainWindow.xaml.cs +++ b/src/MainWindow.xaml.cs @@ -583,7 +583,7 @@ private void UpdateOverlayBounds() _virtualScreenLeft, _virtualScreenTop, _virtualScreenWidth, - _virtualScreenHeight, + _virtualScreenHeight - 1, SWP_NOACTIVATE); }