Julien Lebosquain
10 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
12 additions and
4 deletions
-
src/Avalonia.X11/Clipboard/X11Clipboard.cs
|
|
|
@ -53,12 +53,9 @@ namespace Avalonia.X11.Clipboard |
|
|
|
// We night have already regained the clipboard ownership by the time a SelectionClear message arrives.
|
|
|
|
if (GetOwner() != _handle) |
|
|
|
_storedDataTransfer = null; |
|
|
|
|
|
|
|
_storeAtomTcs?.TrySetResult(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ev.type == XEventName.SelectionRequest) |
|
|
|
else if (ev.type == XEventName.SelectionRequest) |
|
|
|
{ |
|
|
|
var sel = ev.SelectionRequestEvent; |
|
|
|
var resp = new XEvent |
|
|
|
@ -83,6 +80,17 @@ namespace Avalonia.X11.Clipboard |
|
|
|
XSendEvent(_x11.Display, sel.requestor, false, new IntPtr((int)EventMask.NoEventMask), ref resp); |
|
|
|
} |
|
|
|
|
|
|
|
else if (ev.type == XEventName.SelectionNotify) |
|
|
|
{ |
|
|
|
if (ev.SelectionEvent.selection == _x11.Atoms.CLIPBOARD_MANAGER && |
|
|
|
ev.SelectionEvent.target == _x11.Atoms.SAVE_TARGETS && |
|
|
|
_x11.Atoms.CLIPBOARD_MANAGER != IntPtr.Zero && |
|
|
|
_x11.Atoms.SAVE_TARGETS != IntPtr.Zero) |
|
|
|
{ |
|
|
|
_storeAtomTcs?.TrySetResult(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
IntPtr WriteTargetToProperty(IntPtr target, IntPtr window, IntPtr property) |
|
|
|
{ |
|
|
|
if (target == _x11.Atoms.TARGETS) |
|
|
|
|