Browse Source
opengl-control : dont queue update if control is not attached (#13938)
pull/13989/head
Emmanuel Hansen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
4 deletions
-
src/Avalonia.OpenGL/Controls/OpenGlControlBase.cs
|
|
|
@ -220,15 +220,15 @@ namespace Avalonia.OpenGL.Controls |
|
|
|
|
|
|
|
[Obsolete("Use RequestNextFrameRendering()"), EditorBrowsable(EditorBrowsableState.Never)] |
|
|
|
// ReSharper disable once MemberCanBeProtected.Global
|
|
|
|
public new void InvalidateVisual() => RequestNextFrameRendering(); |
|
|
|
|
|
|
|
public new void InvalidateVisual() => RequestNextFrameRendering(); |
|
|
|
|
|
|
|
public void RequestNextFrameRendering() |
|
|
|
{ |
|
|
|
if ((_initialization == null || _initialization is { Status: TaskStatus.RanToCompletion }) && |
|
|
|
!_updateQueued) |
|
|
|
!_updateQueued && _compositor != null) |
|
|
|
{ |
|
|
|
_updateQueued = true; |
|
|
|
_compositor?.RequestCompositionUpdate(_update); |
|
|
|
_compositor.RequestCompositionUpdate(_update); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|