diff options
| author | Po Lu | 2022-03-16 12:33:15 +0800 |
|---|---|---|
| committer | Po Lu | 2022-03-16 12:33:15 +0800 |
| commit | f62a6acd00fa5045fbc537bcaa87756416e246a4 (patch) | |
| tree | ff29580e4f687a5d5ec7841486cd1d62f002f27f /doc/lispref | |
| parent | 5ff13718a53c161c3a0d3e8795544a740c10064b (diff) | |
| download | emacs-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.texi | 8 |
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 |
| 4043 | itself to other frames. | 4043 | itself 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 |
| 4046 | This function begins a drag from @var{frame}, and returns when the | 4046 | This function begins a drag from @var{frame}, and returns when the |
| 4047 | session ends, either because the drop was successful, or because the | 4047 | session ends, either because the drop was successful, or because the |
| 4048 | drop was rejected. The drop occurs when all mouse buttons are | 4048 | drop 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 |
| 4062 | whatever was saved into that selection afterwards. | 4062 | whatever was saved into that selection afterwards. |
| 4063 | 4063 | ||
| 4064 | If @var{return-frame} is non-nil and the mouse moves over an Emacs | ||
| 4065 | frame after first moving out of @var{frame}, then that frame will be | ||
| 4066 | returned immediately. This is useful when you want to treat dragging | ||
| 4067 | content from one frame to another specially, while also being able to | ||
| 4068 | drag content to other programs. | ||
| 4069 | |||
| 4064 | If the drop was rejected or no drop target was found, this function | 4070 | If the drop was rejected or no drop target was found, this function |
| 4065 | returns @code{nil}. Otherwise, it returns a symbol describing the | 4071 | returns @code{nil}. Otherwise, it returns a symbol describing the |
| 4066 | action the target chose to perform, which can differ from @var{action} | 4072 | action the target chose to perform, which can differ from @var{action} |