aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorPo Lu2022-06-29 10:24:14 +0800
committerPo Lu2022-06-29 10:24:14 +0800
commit0e6516a1f022e18f4e32848331954deb0e850d4e (patch)
treeaaf82c350a8aee4ea7867587af7a6555ca6804af /src/keyboard.c
parent9705609c0ef5e426606300da95fed4bec54923fb (diff)
downloademacs-0e6516a1f022e18f4e32848331954deb0e850d4e.tar.gz
emacs-0e6516a1f022e18f4e32848331954deb0e850d4e.zip
Fix reported problem with drag-and-drop inside VirtualBox
* lisp/x-dnd.el (x-dnd-handle-old-kde, x-dnd-handle-offix) (x-dnd-handle-motif): Select window before handling drop, like on Xdnd. (x-dnd-convert-to-offix, x-dnd-do-offix-drop) (x-dnd-handle-unsupported-drop): Accept local selection data and use that instead. * src/keyboard.c (kbd_buffer_get_event): Call unsupported drop function with local selection data as 8th arg. * src/xselect.c (x_get_local_selection): Accept new arg `local_value'. All callers changed. (Fx_get_local_selection): New function. (syms_of_xselect): Update defsubrs. * src/xterm.c (x_dnd_lose_ownership): New function. (x_dnd_begin_drag_and_drop): Unless new variable is true, disown XdndSelection after returning. This supposedly makes drag-and-drop from guest to host work in VirtualBox without causing pointer motion to become choppy afterwards. (syms_of_xterm): New variable `x_dnd_preserve_selection_data' and update doc string of `x-dnd-unsupported-drop-function'. * test/lisp/dnd-tests.el (dnd-tests-begin-text-drag) (dnd-tests-begin-file-drag, dnd-tests-begin-drag-files): Set new variable to nil during tests.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index e5708c06d93..8b8d348c41a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4056,12 +4056,13 @@ kbd_buffer_get_event (KBOARD **kbp,
4056 4056
4057 if (!NILP (Vx_dnd_unsupported_drop_function)) 4057 if (!NILP (Vx_dnd_unsupported_drop_function))
4058 { 4058 {
4059 if (!NILP (call7 (Vx_dnd_unsupported_drop_function, 4059 if (!NILP (call8 (Vx_dnd_unsupported_drop_function,
4060 XCAR (XCDR (event->ie.arg)), event->ie.x, 4060 XCAR (XCDR (event->ie.arg)), event->ie.x,
4061 event->ie.y, XCAR (XCDR (XCDR (event->ie.arg))), 4061 event->ie.y, XCAR (XCDR (XCDR (event->ie.arg))),
4062 make_uint (event->ie.code), 4062 make_uint (event->ie.code),
4063 event->ie.frame_or_window, 4063 event->ie.frame_or_window,
4064 make_int (event->ie.timestamp)))) 4064 make_int (event->ie.timestamp),
4065 Fcopy_sequence (XCAR (event->ie.arg)))))
4065 break; 4066 break;
4066 } 4067 }
4067 4068