aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorPo Lu2022-03-16 12:33:15 +0800
committerPo Lu2022-03-16 12:33:15 +0800
commitf62a6acd00fa5045fbc537bcaa87756416e246a4 (patch)
treeff29580e4f687a5d5ec7841486cd1d62f002f27f /doc/lispref
parent5ff13718a53c161c3a0d3e8795544a740c10064b (diff)
downloademacs-f62a6acd00fa5045fbc537bcaa87756416e246a4.tar.gz
emacs-f62a6acd00fa5045fbc537bcaa87756416e246a4.zip
Better handle drag-and-drop from one Emacs frame to another
* doc/lispref/frames.texi (Drag and Drop): Document new parameter `return-frame' to `x-begin-drag'. * lisp/mouse.el (mouse-drag-and-drop-region): Utilize new feature. * src/xfns.c (Fx_begin_drag): New parameter `return-frame'. * src/xterm.c (x_dnd_begin_drag_and_drop): New parameter return_frame_p. (handle_one_xevent): Set new flags and return frame whenever appropriate. * src/xterm.h: Update prototypes.
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/frames.texi8
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 38897d6a0b3..ea5dd4c675b 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -4042,7 +4042,7 @@ you want to alter Emacs behavior, you can customize these variables.
4042 On some window systems, Emacs also supports dragging contents from 4042 On some window systems, Emacs also supports dragging contents from
4043itself to other frames. 4043itself to other frames.
4044 4044
4045@defun x-begin-drag targets action &optional frame 4045@defun x-begin-drag targets action &optional frame return-frame
4046This function begins a drag from @var{frame}, and returns when the 4046This function begins a drag from @var{frame}, and returns when the
4047session ends, either because the drop was successful, or because the 4047session ends, either because the drop was successful, or because the
4048drop was rejected. The drop occurs when all mouse buttons are 4048drop was rejected. The drop occurs when all mouse buttons are
@@ -4061,6 +4061,12 @@ the drop target, or @code{XdndActionMove}, which means the same as
4061@code{XdndActionCopy}, but also means the caller should delete 4061@code{XdndActionCopy}, but also means the caller should delete
4062whatever was saved into that selection afterwards. 4062whatever was saved into that selection afterwards.
4063 4063
4064If @var{return-frame} is non-nil and the mouse moves over an Emacs
4065frame after first moving out of @var{frame}, then that frame will be
4066returned immediately. This is useful when you want to treat dragging
4067content from one frame to another specially, while also being able to
4068drag content to other programs.
4069
4064If the drop was rejected or no drop target was found, this function 4070If the drop was rejected or no drop target was found, this function
4065returns @code{nil}. Otherwise, it returns a symbol describing the 4071returns @code{nil}. Otherwise, it returns a symbol describing the
4066action the target chose to perform, which can differ from @var{action} 4072action the target chose to perform, which can differ from @var{action}