diff options
| author | Po Lu | 2022-05-28 09:03:29 +0800 |
|---|---|---|
| committer | Po Lu | 2022-05-28 09:03:29 +0800 |
| commit | 3c5fbfe4ac52fb951918f0b0e6a10bade7590fa5 (patch) | |
| tree | 4fb1794201b5a577aef05859ac4ca7cfe2c25961 | |
| parent | 5c07aed894f9822560eabc607674b22aaaaf4780 (diff) | |
| download | emacs-3c5fbfe4ac52fb951918f0b0e6a10bade7590fa5.tar.gz emacs-3c5fbfe4ac52fb951918f0b0e6a10bade7590fa5.zip | |
Improve DND documentation
* doc/lispref/frames.texi (Drag and Drop):
* src/xfns.c (Fx_begin_drag): Document that x-begin-drag may
return immediately if no mouse buttons are held down.
| -rw-r--r-- | doc/lispref/frames.texi | 4 | ||||
| -rw-r--r-- | src/xfns.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index e8765cf958e..e87e2474967 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -4067,7 +4067,9 @@ drag-and-drop operation ends, either because the drop was successful, | |||
| 4067 | or because the drop was rejected. The drop occurs when all mouse | 4067 | or because the drop was rejected. The drop occurs when all mouse |
| 4068 | buttons are released on top of an X window other than @var{frame} (the | 4068 | buttons are released on top of an X window other than @var{frame} (the |
| 4069 | @dfn{drop target}), or any X window if @var{allow-current-frame} is | 4069 | @dfn{drop target}), or any X window if @var{allow-current-frame} is |
| 4070 | non-@code{nil}. | 4070 | non-@code{nil}. If no mouse buttons are held down when the |
| 4071 | drag-and-drop operation begins, this function may immediately return | ||
| 4072 | @code{nil}. | ||
| 4071 | 4073 | ||
| 4072 | @var{targets} is a list of strings describing selection targets, much | 4074 | @var{targets} is a list of strings describing selection targets, much |
| 4073 | like the @var{data-type} argument to @code{gui-get-selection}, that | 4075 | like the @var{data-type} argument to @code{gui-get-selection}, that |
diff --git a/src/xfns.c b/src/xfns.c index 47321a1d6b2..4b5d30bca25 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6827,7 +6827,12 @@ instead. | |||
| 6827 | 6827 | ||
| 6828 | If ALLOW-CURRENT-FRAME is not specified or nil, then the drop target | 6828 | If ALLOW-CURRENT-FRAME is not specified or nil, then the drop target |
| 6829 | is allowed to be FRAME. Otherwise, no action will be taken if the | 6829 | is allowed to be FRAME. Otherwise, no action will be taken if the |
| 6830 | mouse buttons are released on top of FRAME. */) | 6830 | mouse buttons are released on top of FRAME. |
| 6831 | |||
| 6832 | This function will sometimes return immediately if no mouse buttons | ||
| 6833 | are currently held down, and should only be called in situations where | ||
| 6834 | it is known that some are being held down down, such as immediately | ||
| 6835 | after a `down-mouse-1' event. */) | ||
| 6831 | (Lisp_Object targets, Lisp_Object action, Lisp_Object frame, | 6836 | (Lisp_Object targets, Lisp_Object action, Lisp_Object frame, |
| 6832 | Lisp_Object return_frame, Lisp_Object allow_current_frame) | 6837 | Lisp_Object return_frame, Lisp_Object allow_current_frame) |
| 6833 | { | 6838 | { |