diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 334dae06..b24e1e92 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -1041,7 +1041,18 @@ namespace Ink_Canvas AnimationsHelper.HideWithSlideAndFade(BoardBorderTools); AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel); - CountdownTimerWindow.CreateTimerWindow().Show(); + // 参考老计时器的窗口置顶功能:在白板模式下停止窗口置顶 + if (currentMode == 1) // 白板模式 + { + Topmost = false; + } + + var timerWindow = CountdownTimerWindow.CreateTimerWindow(); + timerWindow.Show(); + if (currentMode == 1) // 白板模式 + { + timerWindow.Topmost = true; + } } private void OperatingGuideWindowIcon_MouseUp(object sender, MouseButtonEventArgs e) diff --git a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs index a5e90a55..f8bac5cf 100644 --- a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs +++ b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs @@ -309,6 +309,36 @@ namespace Ink_Canvas private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { isTimerRunning = false; + + if (MainWindow.Settings != null) + { + var mainWindow = Application.Current.MainWindow as MainWindow; + if (mainWindow != null) + { + try + { + var currentModeField = mainWindow.GetType().GetField("currentMode", + System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + if (currentModeField != null) + { + int currentMode = (int)currentModeField.GetValue(mainWindow); + if (currentMode == 1) // 白板模式 + { + mainWindow.Topmost = false; // 保持白板模式下的非置顶状态 + } + else + { + mainWindow.Topmost = true; // 其他模式恢复置顶 + } + } + } + catch + { + // 如果反射失败,使用默认行为 + mainWindow.Topmost = true; + } + } + } } private void BtnClose_MouseUp(object sender, MouseButtonEventArgs e) diff --git a/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache b/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache index c8c2dfbd..57d842b8 100644 Binary files a/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache and b/Ink Canvas/obj/Debug/net472/InkCanvasForClass.csproj.AssemblyReference.cache differ