Browse Source

Xdnd: more logging

pull/20926/head
Julien Lebosquain 6 months ago
parent
commit
57ddb2f24c
No known key found for this signature in database GPG Key ID: 1833CAD10ACC46FD
  1. 12
      src/Avalonia.X11/Selections/DragDrop/X11DragSource.cs

12
src/Avalonia.X11/Selections/DragDrop/X11DragSource.cs

@ -134,8 +134,7 @@ internal sealed class X11DragSource(AvaloniaX11Platform platform) : IPlatformDra
=> _completionSource.Task; => _completionSource.Task;
private DragDropTimeoutManager TimeoutManager private DragDropTimeoutManager TimeoutManager
=> _timeoutManager ??= => _timeoutManager ??= new DragDropTimeoutManager(SelectionHelper.Timeout, OnTimeout);
new DragDropTimeoutManager(SelectionHelper.Timeout, () => Complete(DragDropEffects.None));
private void OnEvent(ref XEvent evt) private void OnEvent(ref XEvent evt)
{ {
@ -600,6 +599,15 @@ internal sealed class X11DragSource(AvaloniaX11Platform platform) : IPlatformDra
private void Complete(DragDropEffects resultEffects) private void Complete(DragDropEffects resultEffects)
=> _completionSource.TrySetResult(resultEffects); => _completionSource.TrySetResult(resultEffects);
private void OnTimeout()
{
_logger?.Log(
this,
_targetState.IsWaitingForStatus ? "Timeout waiting for XdndStatus." : "Timeout waiting for XdndFinished.");
Complete(DragDropEffects.None);
}
public void Dispose() public void Dispose()
{ {
if (_pointerGrabbed) if (_pointerGrabbed)

Loading…
Cancel
Save