aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
authorPo Lu2022-10-25 19:50:57 +0800
committerPo Lu2022-10-25 19:51:08 +0800
commitb6097fe279b03e2fb50fc6af063d7c8f1e55fe8b (patch)
tree8d7a834c70cbb631fbdb086e9b4a2ba35a6b25c2 /src/xselect.c
parentbb95e597a9adcba0080cba85b2270fdf80696b3a (diff)
downloademacs-b6097fe279b03e2fb50fc6af063d7c8f1e55fe8b.tar.gz
emacs-b6097fe279b03e2fb50fc6af063d7c8f1e55fe8b.zip
Fix drag-and-drop bugs on Lucid build
Also, optimize Fx_translate_coordinates to avoid excessive calls to _XReply. * lisp/x-dnd.el (x-dnd-get-drop-rectangle): Return empty drop rectangle if posn-area. * src/xfns.c (Fx_translate_coordinates): Accept arg `require_child'. If not set, allow optimizations based on cached position data. * src/xselect.c (x_handle_dnd_message): Use x_translate_coordinates. * src/xterm.c (x_translate_coordinates): Export function. (x_handle_translate_coordinates): New function. (handle_one_xevent): Fix coding style. * src/xterm.h: Update prototypes.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 498c28af536..db5c7853e7f 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2787,7 +2787,6 @@ x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
2787 unsigned char *data = (unsigned char *) event->data.b; 2787 unsigned char *data = (unsigned char *) event->data.b;
2788 int idata[5]; 2788 int idata[5];
2789 ptrdiff_t i; 2789 ptrdiff_t i;
2790 Window child_return;
2791 2790
2792 for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) 2791 for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
2793 if (dpyinfo->x_dnd_atoms[i] == event->message_type) break; 2792 if (dpyinfo->x_dnd_atoms[i] == event->message_type) break;
@@ -2822,11 +2821,7 @@ x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
2822 if (!root_window_coords) 2821 if (!root_window_coords)
2823 x_relative_mouse_position (f, &x, &y); 2822 x_relative_mouse_position (f, &x, &y);
2824 else 2823 else
2825 XTranslateCoordinates (dpyinfo->display, 2824 x_translate_coordinates (f, root_x, root_y, &x, &y);
2826 dpyinfo->root_window,
2827 FRAME_X_WINDOW (f),
2828 root_x, root_y,
2829 &x, &y, &child_return);
2830 2825
2831 bufp->kind = DRAG_N_DROP_EVENT; 2826 bufp->kind = DRAG_N_DROP_EVENT;
2832 bufp->frame_or_window = frame; 2827 bufp->frame_or_window = frame;