diff options
| author | Po Lu | 2022-06-19 10:31:33 +0800 |
|---|---|---|
| committer | Po Lu | 2022-06-19 10:31:33 +0800 |
| commit | 3285901e9a87f083bf88ac732a3ed2eae6488fec (patch) | |
| tree | ecd5e75899cfc3022a9ea4f8341ce8d31bfed1b4 /src | |
| parent | 8b45e7c6811215a0b70ade840c96e920cdb1569f (diff) | |
| download | emacs-3285901e9a87f083bf88ac732a3ed2eae6488fec.tar.gz emacs-3285901e9a87f083bf88ac732a3ed2eae6488fec.zip | |
Fix timestamps recorded in Motif DND top level leave messages
* src/xterm.c (xm_send_top_level_leave_message): Use X_SHRT_MAX
since Motif treats x and y as signed.
(handle_one_xevent): Use correct time for lmsg.timestamp sent in
response to entering the return-frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c index 885344229a6..f9f3e938e09 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2454,8 +2454,13 @@ xm_send_top_level_leave_message (struct x_display_info *dpyinfo, Window source, | |||
| 2454 | XM_DROP_SITE_NONE, x_dnd_motif_operations, | 2454 | XM_DROP_SITE_NONE, x_dnd_motif_operations, |
| 2455 | XM_DROP_ACTION_DROP_CANCEL); | 2455 | XM_DROP_ACTION_DROP_CANCEL); |
| 2456 | mmsg.timestamp = dmsg->timestamp; | 2456 | mmsg.timestamp = dmsg->timestamp; |
| 2457 | mmsg.x = 65535; | 2457 | |
| 2458 | mmsg.y = 65535; | 2458 | /* Use X_SHRT_MAX instead of the max value of uint16_t since |
| 2459 | that will be interpreted as a plausible position by Motif, | ||
| 2460 | and as such breaks if the drop target is beneath that | ||
| 2461 | position. */ | ||
| 2462 | mmsg.x = X_SHRT_MAX; | ||
| 2463 | mmsg.y = X_SHRT_MAX; | ||
| 2459 | 2464 | ||
| 2460 | xm_send_drag_motion_message (dpyinfo, source, target, &mmsg); | 2465 | xm_send_drag_motion_message (dpyinfo, source, target, &mmsg); |
| 2461 | } | 2466 | } |
| @@ -19757,7 +19762,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19757 | XM_DRAG_REASON_TOP_LEVEL_LEAVE); | 19762 | XM_DRAG_REASON_TOP_LEVEL_LEAVE); |
| 19758 | lmsg.byteorder = XM_BYTE_ORDER_CUR_FIRST; | 19763 | lmsg.byteorder = XM_BYTE_ORDER_CUR_FIRST; |
| 19759 | lmsg.zero = 0; | 19764 | lmsg.zero = 0; |
| 19760 | lmsg.timestamp = event->xmotion.time; | 19765 | lmsg.timestamp = xev->time; |
| 19761 | lmsg.source_window = FRAME_X_WINDOW (x_dnd_frame); | 19766 | lmsg.source_window = FRAME_X_WINDOW (x_dnd_frame); |
| 19762 | 19767 | ||
| 19763 | if (x_dnd_motif_setup_p) | 19768 | if (x_dnd_motif_setup_p) |