diff --git a/AutomaticUpdateVersionControl.txt b/AutomaticUpdateVersionControl.txt
index b1522148..68fc7c72 100644
--- a/AutomaticUpdateVersionControl.txt
+++ b/AutomaticUpdateVersionControl.txt
@@ -1 +1 @@
-1.7.14.0
+1.7.15.0
diff --git a/Ink Canvas/App.xaml.cs b/Ink Canvas/App.xaml.cs
index 973fd1ee..56385a85 100644
--- a/Ink Canvas/App.xaml.cs
+++ b/Ink Canvas/App.xaml.cs
@@ -38,7 +38,7 @@ namespace Ink_Canvas
// 新增:标记是否通过--show参数启动
public static bool StartWithShowMode = false;
// 新增:保存看门狗进程对象
- private static Process watchdogProcess;
+ public static Process watchdogProcess;
// 新增:标记是否为软件内主动退出
public static bool IsAppExitByUser;
// 新增:标记是否启用了UIA置顶功能
@@ -438,7 +438,6 @@ namespace Ink_Canvas
{
_splashScreen.CloseSplashScreen();
_isSplashScreenShown = false;
- LogHelper.WriteLogToFile("启动画面已关闭");
}
catch (Exception ex)
{
@@ -1034,7 +1033,7 @@ namespace Ink_Canvas
}
// 看门狗进程
- private void StartWatchdogIfNeeded()
+ public static void StartWatchdogIfNeeded()
{
// 避免递归启动
if (Environment.GetCommandLineArgs().Contains("--watchdog")) return;
@@ -1077,8 +1076,6 @@ namespace Ink_Canvas
if (IsUIAccessTopMostEnabled)
{
- string exePath = Process.GetCurrentProcess().MainModule.FileName;
- Process.Start(exePath);
Environment.Exit(0);
}
diff --git a/Ink Canvas/AssemblyInfo.cs b/Ink Canvas/AssemblyInfo.cs
index 5d61c823..cbf311f0 100644
--- a/Ink Canvas/AssemblyInfo.cs
+++ b/Ink Canvas/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CJK_mkp")]
[assembly: AssemblyProduct("InkCanvasForClass")]
-[assembly: AssemblyCopyright("Copyright © HARKOTEK Studio 2024")]
+[assembly: AssemblyCopyright("Copyright © CJK_mkp 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.7.14.0")]
-[assembly: AssemblyFileVersion("1.7.14.0")]
+[assembly: AssemblyVersion("1.7.15.0")]
+[assembly: AssemblyFileVersion("1.7.15.0")]
diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml
index 98aba723..48a621a3 100644
--- a/Ink Canvas/MainWindow.xaml
+++ b/Ink Canvas/MainWindow.xaml
@@ -617,7 +617,7 @@
IsOn="False" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchUIAccessTopMost_Toggled" />
-
+
private void StartTopmostMaintenance()
{
+ if (Settings.Advanced.EnableUIAccessTopMost)
+ {
+ return;
+ }
+
if (isTopmostMaintenanceEnabled) return;
if (topmostMaintenanceTimer == null)
@@ -1950,6 +1948,12 @@ namespace Ink_Canvas
{
try
{
+ if (Settings.Advanced.EnableUIAccessTopMost)
+ {
+ StopTopmostMaintenance();
+ return;
+ }
+
if (!Settings.Advanced.IsAlwaysOnTop || !Settings.Advanced.IsNoFocusMode)
{
StopTopmostMaintenance();
@@ -3007,6 +3011,14 @@ namespace Ink_Canvas
{
try
{
+ timerKillProcess.Stop();
+ if (App.watchdogProcess != null && !App.watchdogProcess.HasExited)
+ {
+ App.watchdogProcess.Kill();
+ App.watchdogProcess = null;
+ }
+
+
// 调用UIAccess DLL
if (Environment.Is64BitProcess)
{
@@ -3016,6 +3028,9 @@ namespace Ink_Canvas
{
PrepareUIAccessX86();
}
+
+ App.StartWatchdogIfNeeded();
+ timerKillProcess.Start();
}
catch (Exception ex)
{
diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs
index 2d535209..69ff3c99 100644
--- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs
+++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs
@@ -2844,36 +2844,32 @@ namespace Ink_Canvas
if (Settings.Canvas.ClearCanvasAndClearTimeMachine) timeMachine.ClearStrokeHistory();
- // 清空墨迹后模拟用户重新手动开关多指书写功能
- SimulateMultiTouchToggle();
+ if (Settings.Gesture.IsEnableMultiTouchMode && ToggleSwitchEnableMultiTouchMode != null && ToggleSwitchEnableMultiTouchMode.IsOn)
+ {
+ ReinitializeMultiTouchMode();
+ }
}
private bool lastIsInMultiTouchMode;
- ///
- /// 模拟用户重新手动开关多指书写功能
- ///
- private void SimulateMultiTouchToggle()
+ private void ReinitializeMultiTouchMode()
{
try
{
- // 检查多指书写模式是否启用
- if (ToggleSwitchEnableMultiTouchMode != null && ToggleSwitchEnableMultiTouchMode.IsOn)
+ if (!isInMultiTouchMode)
{
- // 先关闭多指书写模式
- ToggleSwitchEnableMultiTouchMode.IsOn = false;
-
- // 使用Dispatcher.BeginInvoke确保UI更新完成后再重新开启
- Dispatcher.BeginInvoke(new Action(() =>
- {
- // 重新开启多指书写模式
- ToggleSwitchEnableMultiTouchMode.IsOn = true;
- }), DispatcherPriority.Background);
+ isInMultiTouchMode = true;
}
+
+ inkCanvas.TouchDown -= Main_Grid_TouchDown;
+ inkCanvas.TouchDown += MainWindow_TouchDown;
+ inkCanvas.StylusDown += MainWindow_StylusDown;
+ inkCanvas.StylusMove += MainWindow_StylusMove;
+ inkCanvas.StylusUp += MainWindow_StylusUp;
+
}
- catch (Exception ex)
+ catch (Exception)
{
- LogHelper.WriteLogToFile($"模拟多指书写开关时发生错误: {ex.Message}", LogHelper.LogType.Error);
}
}
@@ -3104,7 +3100,15 @@ namespace Ink_Canvas
}
StackPanelPPTButtons.Visibility = Visibility.Collapsed;
- Topmost = false;
+
+ if (Settings.Advanced.EnableUIAccessTopMost)
+ {
+ Topmost = true;
+ }
+ else
+ {
+ Topmost = false;
+ }
break;
}
}
diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs
index d271eb10..b9fc064d 100644
--- a/Ink Canvas/MainWindow_cs/MW_PPT.cs
+++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs
@@ -643,7 +643,7 @@ namespace Ink_Canvas
}
}
- private void OnPPTSlideShowBegin(SlideShowWindow wn)
+ private async void OnPPTSlideShowBegin(SlideShowWindow wn)
{
try
{
@@ -659,13 +659,13 @@ namespace Ink_Canvas
{
if (isFloatingBarFolded)
{
- UnFoldFloatingBar(new object());
+ await UnFoldFloatingBar(new object());
}
}
isStopInkReplay = true;
- Application.Current.Dispatcher.Invoke(() =>
+ await Application.Current.Dispatcher.InvokeAsync(() =>
{
var activePresentation = _pptManager?.GetCurrentActivePresentation();
if (activePresentation != null)
@@ -785,7 +785,14 @@ namespace Ink_Canvas
if (!isFloatingBarFolded)
{
- ViewboxFloatingBarMarginAnimation(60);
+ new Thread(() =>
+ {
+ Thread.Sleep(100);
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ ViewboxFloatingBarMarginAnimation(60);
+ });
+ }).Start();
}
}
catch (Exception ex)
@@ -1584,7 +1591,7 @@ namespace Ink_Canvas
}
}
- private void PPTNavigationBtn_MouseUp(object sender, MouseButtonEventArgs e)
+ private async void PPTNavigationBtn_MouseUp(object sender, MouseButtonEventArgs e)
{
if (lastBorderMouseDownObject != sender) return;
@@ -1633,6 +1640,7 @@ namespace Ink_Canvas
// 控制居中
if (!isFloatingBarFolded)
{
+ await Task.Delay(100);
ViewboxFloatingBarMarginAnimation(60);
}
}
diff --git a/Ink Canvas/Properties/AssemblyInfo.cs b/Ink Canvas/Properties/AssemblyInfo.cs
index 5d61c823..cbf311f0 100644
--- a/Ink Canvas/Properties/AssemblyInfo.cs
+++ b/Ink Canvas/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CJK_mkp")]
[assembly: AssemblyProduct("InkCanvasForClass")]
-[assembly: AssemblyCopyright("Copyright © HARKOTEK Studio 2024")]
+[assembly: AssemblyCopyright("Copyright © CJK_mkp 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.7.14.0")]
-[assembly: AssemblyFileVersion("1.7.14.0")]
+[assembly: AssemblyVersion("1.7.15.0")]
+[assembly: AssemblyFileVersion("1.7.15.0")]
diff --git a/Ink Canvas/Windows/DigitResources.xaml b/Ink Canvas/Windows/DigitResources.xaml
index 312d66c0..22db24dd 100644
--- a/Ink Canvas/Windows/DigitResources.xaml
+++ b/Ink Canvas/Windows/DigitResources.xaml
@@ -2,24 +2,24 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- M2.432,34.536 C2.432,30.6533333 2.83733333,27.2506667 3.648,24.328 C4.45866667,21.4053333 5.6,18.984 7.072,17.064 C8.544,15.144 10.304,13.704 12.352,12.744 C14.4,11.784 16.6826667,11.304 19.2,11.304 C24.576,11.304 28.7146667,13.192 31.616,16.968 C34.5173333,20.744 35.968,26.6 35.968,34.536 C35.968,38.4613333 35.5626667,41.8853333 34.752,44.808 C33.9413333,47.7306667 32.8,50.1626667 31.328,52.104 C29.856,54.0453333 28.0853333,55.496 26.016,56.456 C23.9466667,57.416 21.6533333,57.896 19.136,57.896 C13.7173333,57.896 9.57866667,55.9013333 6.72,51.912 C3.86133333,47.9226667 2.432,42.1306667 2.432,34.536 Z M27.776,34.536 C27.776,33.8533333 27.7653333,33.2026667 27.744,32.584 C27.7226667,31.9653333 27.6906667,31.3573333 27.648,30.76 L11.968,45.032 C13.2906667,48.9146667 15.7013333,50.856 19.2,50.856 C21.9306667,50.856 24.0426667,49.5546667 25.536,46.952 C27.0293333,44.3493333 27.776,40.2106667 27.776,34.536 Z M10.624,34.536 C10.624,35.176 10.6346667,35.784 10.656,36.36 C10.6773333,36.936 10.7093333,37.5226667 10.752,38.12 L26.368,23.848 C25.088,20.1786667 22.6773333,18.344 19.136,18.344 C16.4053333,18.344 14.304,19.656 12.832,22.28 C11.36,24.904 10.624,28.9893333 10.624,34.536 Z
+ M840.61 501.32 q0 244.71 -91.93 371.69 q-91.93 126.99 -249.34 126.99 q-101.85 0 -178.57 -56.21 q-76.72 -56.22 -119.05 -167.99 q-42.33 -111.78 -42.33 -274.48 q0 -164.02 42.33 -276.45 q42.33 -112.44 119.05 -168.65 q76.72 -56.22 178.57 -56.22 q157.41 0 249.34 127.64 q91.93 127.64 91.93 373.68 ZM310.19 501.32 q0 182.54 50.26 275.8 q50.26 93.25 138.89 93.25 q88.62 0 139.55 -92.59 q50.92 -92.59 50.92 -276.46 q0 -183.86 -50.92 -277.77 q-50.92 -93.91 -139.55 -93.91 q-88.63 0 -138.89 93.25 q-50.26 93.25 -50.26 278.44 Z
- M46.184 49.96 L55.976 49.96 L55.976 21.992 L47.528 28.456 L43.688 23.336 L58.28 12.2 L63.912 12.2 L63.912 49.96 L73.512 49.96 L73.512 57 L46.184 57 Z
+ M309 301.5 l0 -145.97 l268.76 -155.53 l113.24 0 l0 1000 l-148.71 0 l0 -830.83 l-233.29 132.33 Z
- M112.272,57 L83.728,57 L83.728,50.792 C84.24,50.3653333 84.88,49.8 85.648,49.096 C86.416,48.392 87.28,47.592 88.24,46.696 C89.2,45.8 90.2133333,44.8186667 91.28,43.752 C92.3466667,42.6853333 93.392,41.576 94.416,40.424 C95.8666667,38.8026667 97.136,37.3306667 98.224,36.008 C99.312,34.6853333 100.208,33.4373333 100.912,32.264 C101.616,31.0906667 102.138667,29.9386667 102.48,28.808 C102.821333,27.6773333 102.992,26.5146667 102.992,25.32 C102.992,24.4666667 102.8,23.6346667 102.416,22.824 C102.032,22.0133333 101.498667,21.2986667 100.816,20.68 C100.133333,20.0613333 99.312,19.5706667 98.352,19.208 C97.392,18.8453333 96.336,18.664 95.184,18.664 C93.648,18.664 92.2506667,18.8986667 90.992,19.368 C89.7333333,19.8373333 88.4213333,20.6266667 87.056,21.736 L83.728,15.848 C85.52,14.568 87.5146667,13.4906667 89.712,12.616 C91.9093333,11.7413333 94.4373333,11.304 97.296,11.304 C99.1306667,11.304 100.890667,11.56 102.576,12.072 C104.261333,12.584 105.754667,13.3413333 107.056,14.344 C108.357333,15.3466667 109.392,16.5946667 110.16,18.088 C110.928,19.5813333 111.312,21.3093333 111.312,23.272 C111.312,24.6373333 111.194667,25.9066667 110.96,27.08 C110.725333,28.2533333 110.362667,29.4266667 109.872,30.6 C109.381333,31.7733333 108.741333,32.9786667 107.952,34.216 C107.162667,35.4533333 106.213333,36.7973333 105.104,38.248 C104.250667,39.3573333 103.322667,40.4773333 102.32,41.608 C101.317333,42.7386667 100.325333,43.816 99.344,44.84 C98.3626667,45.864 97.392,46.824 96.432,47.72 C95.472,48.616 94.608,49.3626667 93.84,49.96 L112.272,49.96 L112.272,57 Z
+ M393.43 872.65 l427.62 0 l0 127.35 l-642.1 0 l0 -92.49 l309.66 -348.53 q84.45 -92.49 117.29 -146.78 q32.84 -54.29 32.84 -118.63 q0 -76.41 -42.23 -119.31 q-42.23 -42.89 -106.56 -42.89 q-67.03 0 -118.63 45.57 q-51.61 45.58 -74.39 124.67 l-115.28 -65.69 q30.83 -112.6 119.97 -174.26 q89.14 -61.66 199.06 -61.66 q83.11 0 149.46 34.85 q66.36 34.85 103.88 99.87 q37.53 65.01 37.53 152.14 q0 87.13 -42.22 163.54 q-42.23 76.41 -149.46 193.03 l-206.44 229.22 Z
- M134.072,50.856 C135.48,50.856 136.770667,50.6746667 137.944,50.312 C139.117333,49.9493333 140.12,49.4373333 140.952,48.776 C141.784,48.1146667 142.434667,47.3466667 142.904,46.472 C143.373333,45.5973333 143.608,44.648 143.608,43.624 C143.608,42.344 143.341333,41.2666667 142.808,40.392 C142.274667,39.5173333 141.538667,38.824 140.6,38.312 C139.661333,37.8 138.530667,37.4373333 137.208,37.224 C135.885333,37.0106667 134.456,36.904 132.92,36.904 L129.336,36.904 L129.336,32.36 L140.088,19.24 L123.896,19.24 L123.896,12.2 L150.008,12.2 L150.008,18.024 L138.744,30.888 L140.216,30.888 C141.709333,30.888 143.16,31.144 144.568,31.656 C145.976,32.168 147.224,32.936 148.312,33.96 C149.4,34.984 150.274667,36.264 150.936,37.8 C151.597333,39.336 151.928,41.1066667 151.928,43.112 C151.928,45.544 151.426667,47.6773333 150.424,49.512 C149.421333,51.3466667 148.098667,52.8933333 146.456,54.152 C144.813333,55.4106667 142.925333,56.3493333 140.792,56.968 C138.658667,57.5866667 136.461333,57.896 134.2,57.896 C132.28,57.896 130.36,57.7253333 128.44,57.384 C126.52,57.0426667 124.664,56.5093333 122.872,55.784 L125.112,48.872 C125.496,49.0853333 126.018667,49.2986667 126.68,49.512 C127.341333,49.7253333 128.088,49.9386667 128.92,50.152 C129.752,50.3653333 130.605333,50.536 131.48,50.664 C132.354667,50.792 133.218667,50.856 134.072,50.856 Z
+ M649.27 472.92 q84.55 27.74 127.48 89.17 q42.93 61.42 42.93 151.25 q0 89.83 -43.59 154.56 q-43.59 64.73 -116.24 98.42 q-72.65 33.68 -158.53 33.68 q-110.96 0 -200.13 -54.82 q-89.17 -54.82 -120.87 -160.5 l113.6 -64.73 q23.78 75.29 80.58 114.26 q56.81 38.97 125.5 38.97 q71.33 0 120.21 -44.25 q48.88 -44.25 48.88 -120.87 q0 -163.81 -229.86 -163.81 l-39.63 0 l1.32 -122.85 l47.56 0 q91.15 0 138.7 -44.25 q47.56 -44.25 47.56 -111.63 q0 -63.41 -40.29 -100.39 q-40.29 -36.99 -103.7 -36.99 q-66.05 0 -113.61 40.95 q-47.56 40.95 -72.65 116.25 l-110.96 -64.73 q31.7 -108.32 114.27 -164.47 q82.56 -56.15 192.2 -56.15 q84.54 0 149.27 32.37 q64.73 32.37 100.4 91.15 q35.67 58.78 35.67 135.41 q0 72.65 -33.69 128.8 q-33.68 56.14 -102.38 85.2 Z
- M194.528,44.52 L186.848,44.52 L186.848,57 L179.104,57 L179.104,44.52 L159.712,44.52 L159.712,38.824 L180,11.88 L186.848,11.88 L186.848,37.864 L194.528,37.864 L194.528,44.52 Z M179.104,23.656 L167.968,37.864 L179.104,37.864 L179.104,23.656 Z
+ M723.06 394.27 l0 264.67 l147.34 0 l0 125.51 l-147.34 0 l0 215.55 l-144.62 0 l0 -215.55 l-448.84 0 l0 -100.96 l376.54 -683.49 l156.89 0 l-364.26 658.94 l279.67 0 l0 -264.67 l144.62 0 Z
- M212.168,50.536 C213.576,50.536 214.877333,50.3653333 216.072,50.024 C217.266667,49.6826667 218.301333,49.192 219.176,48.552 C220.050667,47.912 220.733333,47.1226667 221.224,46.184 C221.714667,45.2453333 221.96,44.1786667 221.96,42.984 C221.96,40.6373333 221.032,38.792 219.176,37.448 C217.32,36.104 214.536,35.432 210.824,35.432 C210.354667,35.432 209.810667,35.4426667 209.192,35.464 C208.573333,35.4853333 207.986667,35.5173333 207.432,35.56 C206.792,35.6026667 206.130667,35.624 205.448,35.624 L205.448,12.2 L228.616,12.2 L228.616,19.88 L212.616,19.88 L212.616,28.648 C212.957333,28.648 213.298667,28.6266667 213.64,28.584 C213.938667,28.584 214.226667,28.5733333 214.504,28.552 C214.781333,28.5306667 215.026667,28.52 215.24,28.52 C217.373333,28.52 219.357333,28.8293333 221.192,29.448 C223.026667,30.0666667 224.626667,30.9946667 225.992,32.232 C227.357333,33.4693333 228.413333,34.9733333 229.16,36.744 C229.906667,38.5146667 230.28,40.4666667 230.28,42.6 C230.28,45.1173333 229.810667,47.3253333 228.872,49.224 C227.933333,51.1226667 226.653333,52.712 225.032,53.992 C223.410667,55.272 221.533333,56.2426667 219.4,56.904 C217.266667,57.5653333 214.984,57.896 212.552,57.896 C211.613333,57.896 210.610667,57.8 209.544,57.608 C208.477333,57.416 207.432,57.1813333 206.408,56.904 C205.384,56.6266667 204.434667,56.3173333 203.56,55.976 C202.685333,55.6346667 201.949333,55.3146667 201.352,55.016 L204.04,48.36 C204.765333,48.7866667 205.885333,49.256 207.4,49.768 C208.914667,50.28 210.504,50.536 212.168,50.536 Z
+ M503.36 355.7 q87.24 0 157.04 39.6 q69.8 39.6 110.07 111.41 q40.27 71.81 40.27 165.77 q0 97.99 -43.63 172.49 q-43.63 74.5 -118.12 114.76 q-74.5 40.27 -161.75 40.27 q-102.02 0 -183.23 -50.34 q-81.2 -50.33 -114.76 -145.63 l115.44 -67.12 q25.5 65.77 72.48 100 q46.98 34.23 108.73 34.23 q79.19 0 125.5 -53.02 q46.31 -53.02 46.31 -140.27 q0 -84.56 -44.97 -139.6 q-44.97 -55.03 -128.19 -55.03 q-60.4 0 -106.04 28.19 q-45.63 28.19 -72.48 75.17 l-96.64 -48.32 l65.77 -538.26 l491.27 0 l0 124.83 l-366.44 0 l-34.9 264.43 q63.09 -33.56 138.26 -33.56 Z
- M271.344,43.112 C271.344,45.2026667 270.949333,47.144 270.16,48.936 C269.370667,50.728 268.293333,52.2853333 266.928,53.608 C265.562667,54.9306667 263.930667,55.976 262.032,56.744 C260.133333,57.512 258.096,57.896 255.92,57.896 C253.701333,57.896 251.621333,57.544 249.68,56.84 C247.738667,56.136 246.042667,55.08 244.592,53.672 C243.141333,52.264 241.989333,50.4933333 241.136,48.36 C240.282667,46.2266667 239.856,43.752 239.856,40.936 C239.856,36.712 240.592,32.872 242.064,29.416 C243.536,25.96 245.424,22.9626667 247.728,20.424 C250.032,17.8853333 252.613333,15.8373333 255.472,14.28 C258.330667,12.7226667 261.168,11.7306667 263.984,11.304 L265.84,17.896 C263.578667,18.3226667 261.466667,19.016 259.504,19.976 C257.541333,20.936 255.792,22.0986667 254.256,23.464 C252.72,24.8293333 251.429333,26.344 250.384,28.008 C249.338667,29.672 248.624,31.4 248.24,33.192 C249.093333,32.1253333 250.373333,31.2186667 252.08,30.472 C253.786667,29.7253333 255.664,29.352 257.712,29.352 C259.632,29.352 261.424,29.6613333 263.088,30.28 C264.752,30.8986667 266.192,31.7946667 267.408,32.968 C268.624,34.1413333 269.584,35.5813333 270.288,37.288 C270.992,38.9946667 271.344,40.936 271.344,43.112 Z M263.28,43.432 C263.28,41.128 262.586667,39.3786667 261.2,38.184 C259.813333,36.9893333 257.946667,36.392 255.6,36.392 C253.893333,36.392 252.357333,36.776 250.992,37.544 C249.626667,38.312 248.624,39.208 247.984,40.232 C247.898667,40.7013333 247.845333,41.224 247.824,41.8 C247.802667,42.376 247.792,42.8346667 247.792,43.176 C247.792,44.2 247.962667,45.1813333 248.304,46.12 C248.645333,47.0586667 249.146667,47.88 249.808,48.584 C250.469333,49.288 251.269333,49.8426667 252.208,50.248 C253.146667,50.6533333 254.234667,50.856 255.472,50.856 C256.453333,50.856 257.413333,50.6746667 258.352,50.312 C259.290667,49.9493333 260.122667,49.448 260.848,48.808 C261.573333,48.168 262.16,47.3893333 262.608,46.472 C263.056,45.5546667 263.28,44.5413333 263.28,43.432 Z
+ M521.48 367.79 q91.27 0 161.74 40.94 q70.47 40.94 109.39 112.08 q38.92 71.14 38.92 159.73 q0 91.27 -42.95 163.75 q-42.95 72.49 -118.79 114.1 q-75.84 41.61 -169.8 41.61 q-95.3 0 -171.14 -40.94 q-75.84 -40.94 -118.12 -113.42 q-42.28 -72.49 -42.28 -166.44 q0 -76.51 28.85 -144.3 q28.85 -67.78 89.26 -163.08 l230.87 -371.81 l159.73 0 l-198.66 315.44 l-44.29 64.43 q41.61 -12.08 87.25 -12.08 ZM498.66 869.8 q81.88 0 130.2 -51.68 q48.32 -51.68 48.32 -133.56 q0 -84.56 -47.65 -136.91 q-47.65 -52.35 -130.87 -52.35 q-81.88 0 -130.21 53.02 q-48.32 53.02 -48.32 136.24 q0 83.23 49 134.24 q49 51 129.54 51 Z
- M282.328 57 L300.76 19.752 L279.896 19.752 L279.896 12.2 L309.08 12.2 L309.08 18.472 L290.456 57 Z
+ M653.27 126.7 l-471.39 0 l0 -126.7 l636.24 0 l0 91.28 l-363.76 908.72 l-160.76 0 l359.67 -873.3 Z
- M319.04,46.056 C319.04,44.5626667 319.285333,43.1973333 319.776,41.96 C320.266667,40.7226667 320.906667,39.6133333 321.696,38.632 C322.485333,37.6506667 323.392,36.7653333 324.416,35.976 C325.44,35.1866667 326.485333,34.4933333 327.552,33.896 C325.418667,32.6586667 323.648,31.1973333 322.24,29.512 C320.832,27.8266667 320.128,25.704 320.128,23.144 C320.128,21.48 320.490667,19.9226667 321.216,18.472 C321.941333,17.0213333 322.954667,15.7626667 324.256,14.696 C325.557333,13.6293333 327.104,12.7973333 328.896,12.2 C330.688,11.6026667 332.629333,11.304 334.72,11.304 C336.64,11.304 338.442667,11.56 340.128,12.072 C341.813333,12.584 343.296,13.3093333 344.576,14.248 C345.856,15.1866667 346.858667,16.328 347.584,17.672 C348.309333,19.016 348.672,20.4986667 348.672,22.12 C348.672,24.6373333 348.021333,26.8346667 346.72,28.712 C345.418667,30.5893333 343.637333,32.2106667 341.376,33.576 C343.936,34.8986667 345.973333,36.456 347.488,38.248 C349.002667,40.04 349.76,42.344 349.76,45.16 C349.76,47.08 349.344,48.8186667 348.512,50.376 C347.68,51.9333333 346.56,53.2666667 345.152,54.376 C343.744,55.4853333 342.090667,56.3493333 340.192,56.968 C338.293333,57.5866667 336.277333,57.896 334.144,57.896 C332.010667,57.896 330.026667,57.608 328.192,57.032 C326.357333,56.456 324.757333,55.656 323.392,54.632 C322.026667,53.608 320.96,52.3706667 320.192,50.92 C319.424,49.4693333 319.04,47.848 319.04,46.056 Z M341.824,44.968 C341.824,43.9013333 341.546667,42.984 340.992,42.216 C340.437333,41.448 339.744,40.7653333 338.912,40.168 C338.08,39.5706667 337.162667,39.0266667 336.16,38.536 C335.157333,38.0453333 334.186667,37.544 333.248,37.032 C331.114667,37.9706667 329.472,39.176 328.32,40.648 C327.168,42.12 326.592,43.5173333 326.592,44.84 C326.592,46.76 327.274667,48.2426667 328.64,49.288 C330.005333,50.3333333 331.904,50.856 334.336,50.856 C336.512,50.856 338.304,50.3546667 339.712,49.352 C341.12,48.3493333 341.824,46.888 341.824,44.968 Z M328.064,23.528 C328.064,24.552 328.288,25.416 328.736,26.12 C329.184,26.824 329.76,27.4426667 330.464,27.976 C331.168,28.5093333 331.968,28.9893333 332.864,29.416 C333.76,29.8426667 334.656,30.2693333 335.552,30.696 C336.234667,30.3546667 336.906667,29.928 337.568,29.416 C338.229333,28.904 338.816,28.3386667 339.328,27.72 C339.84,27.1013333 340.256,26.4613333 340.576,25.8 C340.896,25.1386667 341.056,24.4666667 341.056,23.784 C341.056,22.888 340.864,22.1093333 340.48,21.448 C340.096,20.7866667 339.594667,20.2213333 338.976,19.752 C338.357333,19.2826667 337.664,18.9306667 336.896,18.696 C336.128,18.4613333 335.338667,18.344 334.528,18.344 C333.589333,18.344 332.725333,18.4933333 331.936,18.792 C331.146667,19.0906667 330.464,19.4746667 329.888,19.944 C329.312,20.4133333 328.864,20.968 328.544,21.608 C328.224,22.248 328.064,22.888 328.064,23.528 Z
+ M663.8 459.71 q77.94 34.35 122.2 99.07 q44.25 64.73 44.25 151.92 q0 83.22 -41.61 149.27 q-41.61 66.05 -116.25 103.04 q-74.64 36.99 -169.75 36.99 q-97.75 0 -173.05 -36.99 q-75.3 -36.99 -117.57 -103.04 q-42.27 -66.05 -42.27 -149.27 q0 -85.87 44.91 -151.25 q44.91 -65.39 121.53 -99.74 q-62.09 -30.38 -97.76 -83.22 q-35.67 -52.84 -35.67 -120.22 q0 -70.01 38.31 -128.79 q38.31 -58.78 106.34 -93.13 q68.04 -34.34 155.22 -34.34 q87.19 0 153.24 34.34 q66.05 34.34 101.72 92.47 q35.66 58.13 35.66 129.45 q0 67.38 -34.35 120.22 q-34.34 52.84 -95.12 83.22 ZM502.64 122.85 q-68.69 0 -110.3 38.97 q-41.61 38.97 -41.61 99.74 q0 60.76 41.61 99.73 q41.61 38.97 110.3 38.97 q67.37 0 108.99 -38.97 q41.62 -38.97 41.62 -99.73 q0 -60.77 -41.62 -99.74 q-41.62 -38.97 -108.99 -38.97 ZM502.64 873.18 q79.26 0 128.8 -45.57 q49.54 -45.58 49.54 -124.84 q0 -80.58 -48.88 -128.79 q-48.88 -48.22 -129.46 -48.22 q-83.22 0 -132.1 48.22 q-48.88 48.22 -48.88 128.79 q0 79.26 49.54 124.84 q49.54 45.57 131.44 45.57 Z
- M358.056,26.216 C358.056,24.04 358.429333,22.0346667 359.176,20.2 C359.922667,18.3653333 360.968,16.7973333 362.312,15.496 C363.656,14.1946667 365.277333,13.1706667 367.176,12.424 C369.074667,11.6773333 371.197333,11.304 373.544,11.304 C375.933333,11.304 378.109333,11.6666667 380.072,12.392 C382.034667,13.1173333 383.72,14.1946667 385.128,15.624 C386.536,17.0533333 387.624,18.824 388.392,20.936 C389.16,23.048 389.544,25.4693333 389.544,28.2 C389.544,33.1493333 388.904,37.416 387.624,41 C386.344,44.584 384.626667,47.5706667 382.472,49.96 C380.317333,52.3493333 377.810667,54.184 374.952,55.464 C372.093333,56.744 369.106667,57.5546667 365.992,57.896 L364.2,51.368 C366.546667,51.0693333 368.669333,50.4933333 370.568,49.64 C372.466667,48.7866667 374.12,47.7306667 375.528,46.472 C376.936,45.2133333 378.088,43.784 378.984,42.184 C379.88,40.584 380.456,38.8666667 380.712,37.032 C379.816,37.928 378.664,38.6426667 377.256,39.176 C375.848,39.7093333 374.162667,39.976 372.2,39.976 L372.072,39.976 C370.450667,39.976 368.808,39.6986667 367.144,39.144 C365.48,38.5893333 363.976,37.736 362.632,36.584 C361.288,35.432 360.189333,33.992 359.336,32.264 C358.482667,30.536 358.056,28.52 358.056,26.216 Z M366.12,25.768 C366.12,26.9626667 366.344,28.0186667 366.792,28.936 C367.24,29.8533333 367.826667,30.6213333 368.552,31.24 C369.277333,31.8586667 370.12,32.328 371.08,32.648 C372.04,32.968 373.032,33.128 374.056,33.128 C375.805333,33.128 377.32,32.8506667 378.6,32.296 C379.88,31.7413333 380.818667,31.0586667 381.416,30.248 C381.544,29.352 381.608,28.4986667 381.608,27.688 C381.608,26.4933333 381.437333,25.32 381.096,24.168 C380.754667,23.016 380.242667,21.992 379.56,21.096 C378.877333,20.2 378.024,19.4853333 377,18.952 C375.976,18.4186667 374.802667,18.152 373.48,18.152 C371.389333,18.152 369.64,18.824 368.232,20.168 C366.824,21.512 366.12,23.3786667 366.12,25.768 Z
+ M500 0 q95.3 0 171.14 40.94 q75.84 40.94 118.12 113.43 q42.28 72.48 42.28 166.44 q0 76.51 -27.51 142.95 q-27.51 66.44 -90.61 165.77 l-230.87 370.47 l-159.73 0 l198.66 -315.44 l16.1 -24.16 q20.14 -32.21 26.85 -40.27 q-40.27 12.08 -85.91 12.08 q-91.27 0 -161.74 -40.93 q-70.47 -40.94 -109.39 -112.08 q-38.92 -71.15 -38.92 -159.74 q0 -91.27 42.95 -163.75 q42.95 -72.48 118.79 -114.09 q75.84 -41.61 169.8 -41.61 ZM501.34 504.7 q81.88 0 130.21 -53.02 q48.32 -53.02 48.32 -136.24 q0 -81.88 -49 -133.56 q-49 -51.68 -129.54 -51.68 q-81.88 0 -130.2 51.68 q-48.32 51.68 -48.32 133.56 q0 84.56 47.65 136.91 q47.65 52.35 130.87 52.35 Z
diff --git a/Ink Canvas/Windows/NewStyleTimerWindow.cs b/Ink Canvas/Windows/NewStyleTimerWindow.cs
index 8a8eecae..7c6dcbb0 100644
--- a/Ink Canvas/Windows/NewStyleTimerWindow.cs
+++ b/Ink Canvas/Windows/NewStyleTimerWindow.cs
@@ -6,9 +6,12 @@ using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
+using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Shapes;
using Newtonsoft.Json;
+using System.Runtime.InteropServices;
+using System.Windows.Threading;
namespace Ink_Canvas
{
@@ -46,6 +49,9 @@ namespace Ink_Canvas
hideTimer = new Timer(1000); // 每秒检查一次
hideTimer.Elapsed += HideTimer_Elapsed;
lastActivityTime = DateTime.Now;
+
+ // 添加窗口加载事件处理,确保置顶
+ Loaded += TimerWindow_Loaded;
}
@@ -331,6 +337,9 @@ namespace Ink_Canvas
minimizedWindow = new MinimizedTimerWindow(this);
minimizedWindow.Show();
+ // 确保最小化窗口也置顶
+ minimizedWindow.Topmost = true;
+
// 隐藏主窗口
this.Hide();
}
@@ -777,6 +786,9 @@ namespace Ink_Canvas
// 启动隐藏定时器
hideTimer.Start();
+ // 确保计时器窗口置顶
+ ApplyTimerWindowTopmost();
+
// 保存到最近计时记录
SaveRecentTimer();
}
@@ -879,36 +891,6 @@ 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 CloseButton_Click(object sender, RoutedEventArgs e)
@@ -1329,6 +1311,9 @@ namespace Ink_Canvas
fullscreenWindow = new FullscreenTimerWindow(this);
fullscreenWindow.Show();
+ // 确保全屏窗口也置顶
+ fullscreenWindow.Topmost = true;
+
// 隐藏主窗口
this.Hide();
}
@@ -1342,6 +1327,8 @@ namespace Ink_Canvas
this.Show();
this.Activate();
this.WindowState = WindowState.Normal;
+ // 重新应用置顶
+ ApplyTimerWindowTopmost();
}
else if (fullscreenWindow != null)
{
@@ -1351,7 +1338,94 @@ namespace Ink_Canvas
this.Show();
this.Activate();
this.WindowState = WindowState.Normal;
+ // 重新应用置顶
+ ApplyTimerWindowTopmost();
}
}
+
+ #region Win32 API 声明和置顶管理
+ [DllImport("user32.dll")]
+ private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
+
+ [DllImport("user32.dll")]
+ private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
+
+ [DllImport("user32.dll")]
+ private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
+
+ [DllImport("user32.dll")]
+ private static extern bool IsWindow(IntPtr hWnd);
+
+ [DllImport("user32.dll")]
+ private static extern bool IsWindowVisible(IntPtr hWnd);
+
+ [DllImport("user32.dll")]
+ private static extern bool IsIconic(IntPtr hWnd);
+
+ [DllImport("user32.dll")]
+ private static extern IntPtr GetForegroundWindow();
+
+ [DllImport("user32.dll")]
+ private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
+
+ [DllImport("kernel32.dll")]
+ private static extern uint GetCurrentProcessId();
+
+ private const int GWL_EXSTYLE = -20;
+ private const int WS_EX_TOPMOST = 0x00000008;
+ private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
+ private static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
+ private const uint SWP_NOMOVE = 0x0002;
+ private const uint SWP_NOSIZE = 0x0001;
+ private const uint SWP_NOACTIVATE = 0x0010;
+ private const uint SWP_SHOWWINDOW = 0x0040;
+ private const uint SWP_NOOWNERZORDER = 0x0200;
+
+ ///
+ /// 应用计时器窗口置顶
+ ///
+ private void ApplyTimerWindowTopmost()
+ {
+ try
+ {
+ var hwnd = new WindowInteropHelper(this).Handle;
+ if (hwnd == IntPtr.Zero) return;
+
+ // 强制激活窗口
+ Activate();
+ Focus();
+
+ // 设置WPF的Topmost属性
+ Topmost = true;
+
+ // 使用Win32 API强制置顶
+ // 1. 设置窗口样式为置顶
+ int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
+ SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_TOPMOST);
+
+ // 2. 使用SetWindowPos确保窗口在最顶层
+ SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
+
+ LogHelper.WriteLogToFile("计时器窗口已应用置顶", LogHelper.LogType.Trace);
+ }
+ catch (Exception ex)
+ {
+ LogHelper.WriteLogToFile($"应用计时器窗口置顶失败: {ex.Message}", LogHelper.LogType.Error);
+ }
+ }
+
+ ///
+ /// 窗口加载事件处理,确保置顶
+ ///
+ private void TimerWindow_Loaded(object sender, RoutedEventArgs e)
+ {
+ // 使用延迟确保窗口完全加载后再应用置顶
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ ApplyTimerWindowTopmost();
+ }), DispatcherPriority.Loaded);
+ }
+ #endregion
}
}