From 57ddb2f24c78c6115adbe5248e664d9199ac5ee9 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Wed, 25 Mar 2026 14:49:30 +0100 Subject: [PATCH] Xdnd: more logging --- .../Selections/DragDrop/X11DragSource.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.X11/Selections/DragDrop/X11DragSource.cs b/src/Avalonia.X11/Selections/DragDrop/X11DragSource.cs index 9d527aea58..e83ac48d46 100644 --- a/src/Avalonia.X11/Selections/DragDrop/X11DragSource.cs +++ b/src/Avalonia.X11/Selections/DragDrop/X11DragSource.cs @@ -134,8 +134,7 @@ internal sealed class X11DragSource(AvaloniaX11Platform platform) : IPlatformDra => _completionSource.Task; private DragDropTimeoutManager TimeoutManager - => _timeoutManager ??= - new DragDropTimeoutManager(SelectionHelper.Timeout, () => Complete(DragDropEffects.None)); + => _timeoutManager ??= new DragDropTimeoutManager(SelectionHelper.Timeout, OnTimeout); private void OnEvent(ref XEvent evt) { @@ -600,6 +599,15 @@ internal sealed class X11DragSource(AvaloniaX11Platform platform) : IPlatformDra private void Complete(DragDropEffects 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() { if (_pointerGrabbed)