From: Po Lu Date: Mon, 13 Jun 2022 01:11:08 +0000 (+0800) Subject: Fix special DND event coordinates X-Git-Tag: emacs-29.0.90~1910^2~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=79f50e913d32cb1d1f7757258240147b9234c4d3;p=emacs.git Fix special DND event coordinates * src/xterm.c (x_dnd_note_self_drop): Set DND action to XdndActionPrivate. (x_dnd_begin_drag_and_drop): Don't return XdndPrivate specially here. (handle_one_xevent): Fix order of arguments to x_dnd_note_self_drop. --- diff --git a/src/xterm.c b/src/xterm.c index f2306a6015a..b1e877566fa 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4303,6 +4303,11 @@ x_dnd_note_self_drop (struct x_display_info *dpyinfo, Window target, &win_x, &win_y, &dummy)) return; + /* Emacs can't respond to DND events inside the nested event + loop, so when dragging items to itself, always return + XdndActionPrivate. */ + x_dnd_action = dpyinfo->Xatom_XdndActionPrivate; + EVENT_INIT (ie); ie.kind = DRAG_N_DROP_EVENT; @@ -10805,7 +10810,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, #endif XWindowAttributes root_window_attrs; struct input_event hold_quit; - struct frame *any; char *atom_name, *ask_actions; Lisp_Object action, ltimestamp; specpdl_ref ref, count, base; @@ -11431,15 +11435,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, x_dnd_return_frame_object = NULL; FRAME_DISPLAY_INFO (f)->grabbed = 0; - /* Emacs can't respond to DND events inside the nested event - loop, so when dragging items to itself, always return - XdndActionPrivate. */ - if (x_dnd_end_window != None - && (any = x_any_window_to_frame (FRAME_DISPLAY_INFO (f), - x_dnd_end_window)) - && (allow_current_frame || any != f)) - return unbind_to (base, QXdndActionPrivate); - if (x_dnd_action != None) { block_input (); @@ -18196,9 +18191,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, && x_dnd_last_window_is_frame) { x_dnd_waiting_for_finish = false; - x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window, - event->xbutton.time, event->xbutton.x_root, - event->xbutton.y_root); + x_dnd_note_self_drop (dpyinfo, + x_dnd_last_seen_window, + event->xbutton.x_root, + event->xbutton.y_root, + event->xbutton.time); } else if (x_dnd_last_seen_window != None && x_dnd_last_protocol_version != -1) @@ -19596,7 +19593,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, { x_dnd_waiting_for_finish = false; x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window, - xev->time, xev->root_x, xev->root_y); + xev->root_x, xev->root_y, xev->time); } else if (x_dnd_last_seen_window != None && x_dnd_last_protocol_version != -1)