Skip to content

Commit 9dddda9

Browse files
MartinZikmundmergify[bot]
authored andcommitted
fix: Correctly enqueue the invalidation
(cherry picked from commit 29049e1)
1 parent bae42bc commit 9dddda9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Uno.UI.Runtime.Skia.MacOS/UI/Xaml/Window/MacOSWindowHost.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ public static unsafe void Register()
204204

205205
void IXamlRootHost.InvalidateRender()
206206
{
207-
if (_winUIWindow.RootElement is not { } rootElement || (rootElement.IsArrangeDirtyOrArrangeDirtyPath || rootElement.IsMeasureDirtyOrMeasureDirtyPath))
207+
if (!SkiaRenderHelper.CanRecordPicture(_winUIWindow.RootElement))
208208
{
209209
// Try again next tick
210-
NativeDispatcher.Main.Enqueue(() => ((IXamlRootHost)this).InvalidateRender());
210+
NativeDispatcher.Main.Enqueue(() => ((IXamlRootHost)this).InvalidateRender(), NativeDispatcherPriority.Idle);
211211
return;
212212
}
213213

@@ -219,14 +219,12 @@ void IXamlRootHost.InvalidateRender()
219219
var (picture, path) = SkiaRenderHelper.RecordPictureAndReturnPath(
220220
(int)_nativeWindowSize.Width,
221221
(int)_nativeWindowSize.Height,
222-
rootElement,
222+
_winUIWindow.RootElement,
223223
invertPath: false);
224224

225225
Interlocked.Exchange(ref _picture, picture);
226226
Interlocked.Exchange(ref _clipPath, path);
227227

228-
RootElement?.XamlRoot?.InvokeFramePainted();
229-
230228
_winUIWindow.RootElement?.XamlRoot?.InvalidateOverlays();
231229

232230
NativeUno.uno_window_invalidate(_nativeWindow.Handle);

0 commit comments

Comments
 (0)