emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ad2bb3e9f36: Properly translate touch screen events into mouse dr


From: Po Lu
Subject: master ad2bb3e9f36: Properly translate touch screen events into mouse drag ones
Date: Mon, 2 Oct 2023 03:43:17 -0400 (EDT)

branch: master
commit ad2bb3e9f36d1a4f25e1e2228586331b40a30a46
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Properly translate touch screen events into mouse drag ones
    
    * doc/lispref/commands.texi (Drag Events): Correct misleading
    example form and reword subsequent elaboration.
    
    * lisp/touch-screen.el (touch-screen-handle-point-up)
    <mouse-drag>: Set posns representing drag start and terminus to
    mouse position lists, in lieu of pairs between windows and posns
    employed previously.
---
 doc/lispref/commands.texi | 17 ++++++++---------
 lisp/touch-screen.el      |  8 ++------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index a69879c30a9..6601135cb85 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1854,20 +1854,19 @@ represented in Lisp as lists.  The lists record both 
the starting mouse
 position and the final position, like this:
 
 @example
-(@var{event-type}
- (@var{window1} START-POSITION)
- (@var{window2} END-POSITION))
+(@var{event-type} @var{start-position} @var{end-position})
 @end example
 
 For a drag event, the name of the symbol @var{event-type} contains the
 prefix @samp{drag-}.  For example, dragging the mouse with button 2
 held down generates a @code{drag-mouse-2} event.  The second and third
-elements of the event give the starting and ending position of the
-drag, as mouse position lists (@pxref{Click Events}).  You can access
-the second element of any mouse event in the same way.  However, the
-drag event may end outside the boundaries of the frame that was
-initially selected.  In that case, the third element's position list
-contains that frame in place of a window.
+elements of the event, @var{start-position} and @var{end-position} in
+the foregoing illustration, are set to the start and end positions of
+the drag as mouse position lists (@pxref{Click Events}).  You can
+access the second element of any mouse event in the same way.
+However, the drag event may end outside the boundaries of the frame
+that was initially selected.  In that case, the third element's
+position list contains that frame in place of a window.
 
 The @samp{drag-} prefix follows the modifier key prefixes such as
 @samp{C-} and @samp{M-}.
diff --git a/lisp/touch-screen.el b/lisp/touch-screen.el
index 23c5bbf71ff..2621aebf037 100644
--- a/lisp/touch-screen.el
+++ b/lisp/touch-screen.el
@@ -1140,9 +1140,7 @@ is not read-only."
                               ;; ... generate a mouse-1 event...
                               (list 'mouse-1 posn)
                             ;; ... otherwise, generate a drag-mouse-1 event.
-                            (list 'drag-mouse-1 (cons old-window
-                                                      old-posn)
-                                  (cons new-window posn))))
+                            (list 'drag-mouse-1 old-posn posn)))
                       (if (and (eq new-window old-window)
                                (eq new-point old-point)
                                (windowp new-window)
@@ -1150,9 +1148,7 @@ is not read-only."
                           ;; ... generate a mouse-1 event...
                           (list 'mouse-1 posn)
                         ;; ... otherwise, generate a drag-mouse-1 event.
-                        (list 'drag-mouse-1 (cons old-window
-                                                  old-posn)
-                              (cons new-window posn)))))))
+                        (list 'drag-mouse-1 old-posn posn))))))
           ((eq what 'mouse-1-menu)
            ;; Generate a `down-mouse-1' event at the position the tap
            ;; took place.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]