You should design @var{body} to return when it sees the up-event that
indicates the release of the button, or whatever kind of event means
it is time to stop tracking.
+
+The @code{track-mouse} form causes Emacs to generate mouse motion
+events by binding the variable @code{mouse-tracking} to a
+non-@code{nil} value. If that variable has the special value
+@code{dragging}, it additionally instructs the display engine to
+refrain from changing the shape of the mouse pointer. This is
+desirable in Lisp programs that require mouse dragging across large
+portions of Emacs display, which might otherwise cause the mouse
+pointer to change its shape according to the display portion it hovers
+on (@pxref{Pointer Shape}). Therefore, Lisp programs that need the
+mouse pointer to retain its original shape during dragging should bind
+@code{track-mouse} to the value @code{dragging} at the beginning of
+their @var{body}.
@end defspec
The usual purpose of tracking mouse motion is to indicate on the screen
** `inhibit-point-motion-hooks' now defaults to t and is obsolete.
++++
+** `track-mouse' no longer freezes the shape of the mouse pointer.
+The `track-mouse' form no longer refrains from changing the shape of
+the mouse pointer for the entire time the body of that form is
+executed. Lisp programs that use `track-mouse' for dragging across
+large portions of the Emacs display, and want to avoid changes in the
+pointer shape during dragging, should bind the variable `track-mouse'
+to the special value `dragging' in the body of the form.
+
** The optional `predicate' argument of `lisp-complete-symbol' no longer
has any effect. (This change was made in Emacs 24.4 but was not
advertised at the time.)
(col-scrolling-p (mouse-drag-should-do-col-scrolling)))
(select-window start-window)
(track-mouse
+ ;; Don't change the mouse pointer shape while we drag.
+ (setq track-mouse 'dragging)
(while (progn
(setq event (read-event)
end (event-end event)
(setq dragged t)
(adjust-window-trailing-edge window growth nil t))
(setq last-position position))))))
- ;; Start tracking.
- (setq track-mouse t)
+ ;; Start tracking. The special value 'dragging' signals the
+ ;; display engine to freeze the mouse pointer shape for as long
+ ;; as we drag.
+ (setq track-mouse 'dragging)
;; Loop reading events and sampling the position of the mouse.
(setq exitfun
(set-transient-map
(let ((drags 0)
event)
(track-mouse
+ ;; Signal the display engine to freeze the mouse pointer shape.
+ (setq track-mouse 'dragging)
(while (mouse-movement-p (setq event (read-event)))
(setq drags (1+ drags))
(when (eq window (posn-window (event-end event)))
(artist-no-rb-set-point1 x1 y1))
(unwind-protect
(track-mouse
+ ;; We don't want flickering of mouse pointer shape while we
+ ;; drag the mouse.
+ (setq track-mouse 'dragging)
(while (or (mouse-movement-p ev)
(member 'down (event-modifiers ev)))
(setq ev-start-pos (artist-coord-win-to-buf
define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
{
/* Do not change cursor shape while dragging mouse. */
- if (!NILP (do_mouse_tracking))
+ if (EQ (do_mouse_tracking, Qdragging))
return;
if (!NILP (pointer))
DEFSYM (Qarrow, "arrow");
/* also Qtext */
+ DEFSYM (Qdragging, "dragging");
+
DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
list_of_error = list1 (list2 (Qerror, Qvoid_variable));