emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4b2b3c45d3: Some minor fixes to Motif DND support


From: Po Lu
Subject: master 4b2b3c45d3: Some minor fixes to Motif DND support
Date: Sun, 17 Apr 2022 20:27:58 -0400 (EDT)

branch: master
commit 4b2b3c45d39721a60f8ed63c2a3e3ec9ff7e5004
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Some minor fixes to Motif DND support
    
    * src/xterm.c (xm_write_drag_initiator_info): Swap cardinal
    values if wrong byteorder.
    (xm_setup_dnd_targets): Read LONG_MAX amount of drag targets.
---
 src/xterm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 4241b4d0d6..e00b38a681 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1353,6 +1353,12 @@ xm_write_drag_initiator_info (Display *dpy, Window wdesc,
   buf[0] = info->byteorder;
   buf[1] = info->protocol;
 
+  if (info->byteorder != XM_BYTE_ORDER_CUR_FIRST)
+    {
+      SWAPCARD16 (info->table_index);
+      SWAPCARD16 (info->selection);
+    }
+
   *((uint16_t *) (buf + 2)) = info->table_index;
   *((uint32_t *) (buf + 4)) = info->selection;
 
@@ -1473,8 +1479,7 @@ xm_setup_dnd_targets (struct x_display_info *dpyinfo,
   XGrabServer (dpyinfo->display);
   rc = XGetWindowProperty (dpyinfo->display, drag_window,
                           dpyinfo->Xatom_MOTIF_DRAG_TARGETS,
-                          /* Do larger values occur in practice? */
-                          0L, 20000L, False,
+                          0L, LONG_MAX, False,
                           dpyinfo->Xatom_MOTIF_DRAG_TARGETS,
                           &actual_type, &actual_format, &nitems,
                           &bytes_remaining, &tmp_data) == Success;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]