From 1302c329eb09b40a8895198fc0ec98b3abac6b96 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 15 Jun 2022 11:37:39 +0800 Subject: [PATCH] Fix link action handling with Motif DND * src/xterm.c (enum xm_drag_operation): New alternate definition. (XM_DRAG_OPERATION_IS_LINK): New macro. (handle_one_xevent): Use it instead. --- src/xterm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 7f78f40bb79..bf8a33f70c9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1504,12 +1504,16 @@ typedef struct xm_top_level_leave_message enum xm_drag_operation { - XM_DRAG_NOOP = 0, - XM_DRAG_MOVE = (1L << 0), - XM_DRAG_COPY = (1L << 1), - XM_DRAG_LINK = (1L << 2), + XM_DRAG_NOOP = 0, + XM_DRAG_MOVE = (1L << 0), + XM_DRAG_COPY = (1L << 1), + XM_DRAG_LINK = (1L << 2), + XM_DRAG_LINK_REC = 3, }; +#define XM_DRAG_OPERATION_IS_LINK(op) ((op) == XM_DRAG_LINK \ + || (op) == XM_DRAG_LINK_REC) + enum xm_drag_action { XM_DROP_ACTION_DROP = 0, @@ -16097,7 +16101,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (operation != XM_DRAG_MOVE && operation != XM_DRAG_COPY - && operation != XM_DRAG_LINK) + && XM_DRAG_OPERATION_IS_LINK (operation)) { x_dnd_waiting_for_finish = false; goto done; @@ -16121,7 +16125,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_dnd_action = dpyinfo->Xatom_XdndActionCopy; break; - case XM_DRAG_LINK: + /* This means XM_DRAG_OPERATION_IS_LINK (operation). */ + default: x_dnd_action = dpyinfo->Xatom_XdndActionLink; break; } -- 2.39.2