]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix link action handling with Motif DND
authorPo Lu <luangruo@yahoo.com>
Wed, 15 Jun 2022 03:37:39 +0000 (11:37 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 15 Jun 2022 03:37:39 +0000 (11:37 +0800)
* 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

index 7f78f40bb7995f00afb6bd7255a7f628dc627a43..bf8a33f70c93b9210f08b9176abd6b08e7a0595a 100644 (file)
@@ -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;
                  }