diff options
| author | Po Lu | 2022-06-13 09:11:08 +0800 |
|---|---|---|
| committer | Po Lu | 2022-06-13 09:11:08 +0800 |
| commit | 79f50e913d32cb1d1f7757258240147b9234c4d3 (patch) | |
| tree | b54b534f7e972c80fd40b3505768a8df0e21c8b1 /src | |
| parent | 72e0ef74d0ed242cd75226aef887d87391c23f6d (diff) | |
| download | emacs-79f50e913d32cb1d1f7757258240147b9234c4d3.tar.gz emacs-79f50e913d32cb1d1f7757258240147b9234c4d3.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 25 |
1 files changed, 11 insertions, 14 deletions
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, | |||
| 4303 | &win_x, &win_y, &dummy)) | 4303 | &win_x, &win_y, &dummy)) |
| 4304 | return; | 4304 | return; |
| 4305 | 4305 | ||
| 4306 | /* Emacs can't respond to DND events inside the nested event | ||
| 4307 | loop, so when dragging items to itself, always return | ||
| 4308 | XdndActionPrivate. */ | ||
| 4309 | x_dnd_action = dpyinfo->Xatom_XdndActionPrivate; | ||
| 4310 | |||
| 4306 | EVENT_INIT (ie); | 4311 | EVENT_INIT (ie); |
| 4307 | 4312 | ||
| 4308 | ie.kind = DRAG_N_DROP_EVENT; | 4313 | ie.kind = DRAG_N_DROP_EVENT; |
| @@ -10805,7 +10810,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, | |||
| 10805 | #endif | 10810 | #endif |
| 10806 | XWindowAttributes root_window_attrs; | 10811 | XWindowAttributes root_window_attrs; |
| 10807 | struct input_event hold_quit; | 10812 | struct input_event hold_quit; |
| 10808 | struct frame *any; | ||
| 10809 | char *atom_name, *ask_actions; | 10813 | char *atom_name, *ask_actions; |
| 10810 | Lisp_Object action, ltimestamp; | 10814 | Lisp_Object action, ltimestamp; |
| 10811 | specpdl_ref ref, count, base; | 10815 | specpdl_ref ref, count, base; |
| @@ -11431,15 +11435,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, | |||
| 11431 | x_dnd_return_frame_object = NULL; | 11435 | x_dnd_return_frame_object = NULL; |
| 11432 | FRAME_DISPLAY_INFO (f)->grabbed = 0; | 11436 | FRAME_DISPLAY_INFO (f)->grabbed = 0; |
| 11433 | 11437 | ||
| 11434 | /* Emacs can't respond to DND events inside the nested event | ||
| 11435 | loop, so when dragging items to itself, always return | ||
| 11436 | XdndActionPrivate. */ | ||
| 11437 | if (x_dnd_end_window != None | ||
| 11438 | && (any = x_any_window_to_frame (FRAME_DISPLAY_INFO (f), | ||
| 11439 | x_dnd_end_window)) | ||
| 11440 | && (allow_current_frame || any != f)) | ||
| 11441 | return unbind_to (base, QXdndActionPrivate); | ||
| 11442 | |||
| 11443 | if (x_dnd_action != None) | 11438 | if (x_dnd_action != None) |
| 11444 | { | 11439 | { |
| 11445 | block_input (); | 11440 | block_input (); |
| @@ -18196,9 +18191,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 18196 | && x_dnd_last_window_is_frame) | 18191 | && x_dnd_last_window_is_frame) |
| 18197 | { | 18192 | { |
| 18198 | x_dnd_waiting_for_finish = false; | 18193 | x_dnd_waiting_for_finish = false; |
| 18199 | x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window, | 18194 | x_dnd_note_self_drop (dpyinfo, |
| 18200 | event->xbutton.time, event->xbutton.x_root, | 18195 | x_dnd_last_seen_window, |
| 18201 | event->xbutton.y_root); | 18196 | event->xbutton.x_root, |
| 18197 | event->xbutton.y_root, | ||
| 18198 | event->xbutton.time); | ||
| 18202 | } | 18199 | } |
| 18203 | else if (x_dnd_last_seen_window != None | 18200 | else if (x_dnd_last_seen_window != None |
| 18204 | && x_dnd_last_protocol_version != -1) | 18201 | && x_dnd_last_protocol_version != -1) |
| @@ -19596,7 +19593,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19596 | { | 19593 | { |
| 19597 | x_dnd_waiting_for_finish = false; | 19594 | x_dnd_waiting_for_finish = false; |
| 19598 | x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window, | 19595 | x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window, |
| 19599 | xev->time, xev->root_x, xev->root_y); | 19596 | xev->root_x, xev->root_y, xev->time); |
| 19600 | } | 19597 | } |
| 19601 | else if (x_dnd_last_seen_window != None | 19598 | else if (x_dnd_last_seen_window != None |
| 19602 | && x_dnd_last_protocol_version != -1) | 19599 | && x_dnd_last_protocol_version != -1) |