From: Po Lu Date: Mon, 18 Apr 2022 00:25:45 +0000 (+0800) Subject: Some minor fixes to Motif DND support X-Git-Tag: emacs-29.0.90~1931^2~444 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b2b3c45d39721a60f8ed63c2a3e3ec9ff7e5004;p=emacs.git 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. --- diff --git a/src/xterm.c b/src/xterm.c index 4241b4d0d6b..e00b38a6817 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;