From e9bb2d7f4ec47bd3a19df8ceaa43d0ad36dbf9b3 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 1 Jun 2022 18:24:05 +0800 Subject: [PATCH] Fix Motif DND return value upon transfer failure * src/xterm.c (handle_one_xevent): Make XmTRANSFER_FAILURE clear DND action. --- src/xterm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index 85339619935..484637807aa 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -15502,7 +15502,14 @@ handle_one_xevent (struct x_display_info *dpyinfo, && eventp->selection == dpyinfo->Xatom_XdndSelection && (eventp->target == dpyinfo->Xatom_XmTRANSFER_SUCCESS || eventp->target == dpyinfo->Xatom_XmTRANSFER_FAILURE)) - x_dnd_waiting_for_finish = false; + { + x_dnd_waiting_for_finish = false; + + /* If the transfer failed, then return nil from + `x-begin-drag'. */ + if (eventp->target == dpyinfo->Xatom_XmTRANSFER_FAILURE) + x_dnd_action = None; + } } break; -- 2.39.2