diff --git a/Ink Canvas/Helpers/PPTUIManager.cs b/Ink Canvas/Helpers/PPTUIManager.cs index 1c65e9ef..1fd354a5 100644 --- a/Ink Canvas/Helpers/PPTUIManager.cs +++ b/Ink Canvas/Helpers/PPTUIManager.cs @@ -107,6 +107,8 @@ namespace Ink_Canvas.Helpers System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, true); }), DispatcherPriority.ApplicationIdle); + + _mainWindow.isFullScreenApplied = true; // 标记已应用全屏处理 } } else @@ -127,6 +129,8 @@ namespace Ink_Canvas.Helpers workingArea.X, workingArea.Y, workingArea.Width, workingArea.Height, true); }), DispatcherPriority.ApplicationIdle); + + _mainWindow.isFullScreenApplied = false; // 标记全屏处理已还原 } } } diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 8863f794..8ecc2c31 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -67,6 +67,9 @@ namespace Ink_Canvas // 设置面板相关状态 private bool userChangedNoFocusModeInSettings; private bool isTemporarilyDisablingNoFocusMode = false; + + // 全屏处理状态标志 + public bool isFullScreenApplied = false; diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 87fa368c..2c71db66 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -3075,6 +3075,8 @@ namespace Ink_Canvas workingArea.Left, workingArea.Top, workingArea.Width, workingArea.Height, true); }), DispatcherPriority.ApplicationIdle); + + isFullScreenApplied = false; // 标记全屏处理已还原 } // 在屏幕模式下恢复基础浮动栏的显示 @@ -3144,6 +3146,8 @@ namespace Ink_Canvas System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, true); }), DispatcherPriority.ApplicationIdle); + + isFullScreenApplied = true; // 标记已应用全屏处理 } ViewboxFloatingBar.Visibility = Visibility.Collapsed; @@ -3201,6 +3205,7 @@ namespace Ink_Canvas { if (GridTransparencyFakeBackground.Background == Brushes.Transparent) { + // 进入批注模式 GridTransparencyFakeBackground.Opacity = 1; GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF")); inkCanvas.IsHitTestVisible = true; @@ -3225,6 +3230,21 @@ namespace Ink_Canvas } BtnHideInkCanvas.Content = "隐藏\n画板"; + + // 进入批注模式时的全屏处理(仅当未应用过全屏处理时) + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && !isFullScreenApplied) + { + // 设置为画板模式,允许全屏操作 + AvoidFullScreenHelper.SetBoardMode(true); + Dispatcher.BeginInvoke(new Action(() => + { + MainWindow.MoveWindow(new WindowInteropHelper(this).Handle, 0, 0, + System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, + System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, true); + }), DispatcherPriority.ApplicationIdle); + + isFullScreenApplied = true; // 标记已应用全屏处理 + } } else { @@ -3275,6 +3295,27 @@ namespace Ink_Canvas GridBackgroundCoverHolder.Visibility = Visibility.Collapsed; + // 退出批注模式时的全屏还原(仅当之前应用过全屏处理且不在白板模式时) + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && + isFullScreenApplied && + currentMode == 0 && // 不在白板模式 + BtnPPTSlideShowEnd.Visibility != Visibility.Visible) // 不在PPT放映模式 + { + // 恢复为非画板模式,重新启用全屏限制 + AvoidFullScreenHelper.SetBoardMode(false); + + Dispatcher.BeginInvoke(new Action(() => + { + // 退出批注模式,恢复到工作区域大小 + var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; + MainWindow.MoveWindow(new WindowInteropHelper(this).Handle, + workingArea.Left, workingArea.Top, + workingArea.Width, workingArea.Height, true); + }), DispatcherPriority.ApplicationIdle); + + isFullScreenApplied = false; // 标记全屏处理已还原 + } + if (currentMode != 0) { SaveStrokes();