|
1 | | -using System.Windows; |
2 | | -using System.Windows.Input; |
3 | | -using System.Windows.Ink; |
4 | | -using System.Windows.Threading; |
| 1 | +using System.Runtime.InteropServices; |
| 2 | +using Jalium.UI; |
| 3 | +using Jalium.UI.Controls.Ink; |
| 4 | +using Jalium.UI.Threading; |
5 | 5 | using SkiaAnnotate.Windows; |
6 | 6 |
|
7 | 7 | namespace SkiaAnnotate.Services; |
@@ -103,19 +103,31 @@ private void Enter(PptInteropService pptInteropService, Rect bounds, int current |
103 | 103 | _overlayWindow = overlayWindow; |
104 | 104 | overlayWindow.Show(); |
105 | 105 | overlayWindow.Activate(); |
106 | | - Keyboard.Focus(overlayWindow); |
107 | 106 | _activeSlideNumber = currentSlideNumber; |
108 | 107 | _isSlideContentInitialized = false; |
109 | 108 | SyncStrokesForSlide(currentSlideNumber); |
110 | 109 | } |
111 | 110 |
|
112 | 111 | private static Rect GetFullscreenCanvasBounds() |
113 | 112 | { |
| 113 | + return GetSystemMetricsBounds(); |
| 114 | + } |
| 115 | + |
| 116 | + [DllImport("user32.dll")] |
| 117 | + private static extern int GetSystemMetrics(int nIndex); |
| 118 | + |
| 119 | + private static Rect GetSystemMetricsBounds() |
| 120 | + { |
| 121 | + const int smXVirtualScreen = 76; |
| 122 | + const int smYVirtualScreen = 77; |
| 123 | + const int smCxVirtualScreen = 78; |
| 124 | + const int smCyVirtualScreen = 79; |
| 125 | + |
114 | 126 | return new Rect( |
115 | | - SystemParameters.VirtualScreenLeft, |
116 | | - SystemParameters.VirtualScreenTop, |
117 | | - SystemParameters.VirtualScreenWidth, |
118 | | - SystemParameters.VirtualScreenHeight); |
| 127 | + GetSystemMetrics(smXVirtualScreen), |
| 128 | + GetSystemMetrics(smYVirtualScreen), |
| 129 | + GetSystemMetrics(smCxVirtualScreen), |
| 130 | + GetSystemMetrics(smCyVirtualScreen)); |
119 | 131 | } |
120 | 132 |
|
121 | 133 | private void SyncStrokesForSlide(int currentSlideNumber) |
@@ -174,7 +186,6 @@ private void HandlePreviousSlideRequested(PptInteropService pptInteropService) |
174 | 186 |
|
175 | 187 | private void ScheduleSlideSync(PptInteropService pptInteropService) |
176 | 188 | { |
177 | | - // First sync immediately, then retry a few short ticks to catch transition lag. |
178 | 189 | var currentSlideNumber = pptInteropService.GetCurrentSlideNumberInShow(); |
179 | 190 | SyncStrokesForSlide(currentSlideNumber); |
180 | 191 |
|
|
0 commit comments