Browse Source

[X11] Ensure XSync before calling CreateNativeControlCore (#15952)

property_transition_stops_repro
Nikita Tsukanov 2 years ago
committed by GitHub
parent
commit
4153ef720b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      src/Avalonia.X11/X11NativeControlHost.cs

12
src/Avalonia.X11/X11NativeControlHost.cs

@ -19,14 +19,12 @@ namespace Avalonia.X11
public INativeControlHostDestroyableControlHandle CreateDefaultChild(IPlatformHandle parent)
{
var ch = new DumbWindow(_platform.Info);
XSync(_platform.Display, false);
return ch;
return new DumbWindow(_platform.Info, true);
}
public INativeControlHostControlTopLevelAttachment CreateNewAttachment(Func<IPlatformHandle, IPlatformHandle> create)
{
var holder = new DumbWindow(_platform.Info, Window.Handle.Handle);
var holder = new DumbWindow(_platform.Info, true, Window.Handle.Handle);
Attachment attachment = null;
try
{
@ -50,7 +48,7 @@ namespace Avalonia.X11
if (!IsCompatibleWith(handle))
throw new ArgumentException(handle.HandleDescriptor + " is not compatible with the current window",
nameof(handle));
var attachment = new Attachment(_platform.Display, new DumbWindow(_platform.Info, Window.Handle.Handle),
var attachment = new Attachment(_platform.Display, new DumbWindow(_platform.Info, false, Window.Handle.Handle),
_platform.OrphanedWindow, handle) { AttachedTo = this };
return attachment;
}
@ -61,7 +59,7 @@ namespace Avalonia.X11
{
private readonly IntPtr _display;
public DumbWindow(X11Info x11, IntPtr? parent = null)
public DumbWindow(X11Info x11, bool sync, IntPtr? parent = null)
{
_display = x11.Display;
/*Handle = XCreateSimpleWindow(x11.Display, XLib.XDefaultRootWindow(_display),
@ -83,6 +81,8 @@ namespace Avalonia.X11
new UIntPtr((uint)(SetWindowValuemask.BorderPixel | SetWindowValuemask.BitGravity |
SetWindowValuemask.BackPixel |
SetWindowValuemask.WinGravity | SetWindowValuemask.BackingStore)), ref attr);
if(sync)
XSync(x11.Display, false);
}
public IntPtr Handle { get; private set; }

Loading…
Cancel
Save