redefine this function to suit your own tastes."
(if (null mouse-avoidance-pointer-shapes)
(progn
- (setq mouse-avoidance-pointer-shapes
- (mapcar (lambda (x) (symbol-value (intern x)))
- (all-completions "x-pointer-" obarray
- (lambda (x)
- (and (boundp x)
- (integerp (symbol-value x)))))))))
+ (dolist (i (all-completions "x-pointer-" obarray
+ (lambda (x)
+ (and (boundp x)
+ (integerp (symbol-value x))))))
+ (ignore-errors
+ (let ((value (symbol-value (intern i))))
+ (when (< value x-pointer-invisible)
+ (push value mouse-avoidance-pointer-shapes)))))))
(seq-random-elt mouse-avoidance-pointer-shapes))
(defun mouse-avoidance-ignore-p ()
(not (eq (car mp) (selected-frame)))
;; Don't interfere with ongoing `mouse-drag-and-drop-region'
;; (Bug#36269).
- (eq track-mouse 'dropping)
+ (or (eq track-mouse 'dropping)
+ (eq track-mouse 'drag-source))
;; Don't do anything if last event was a mouse event.
;; FIXME: this code fails in the case where the mouse was moved
;; since the last key-press but without generating any event.
};
/* This array must stay in sync with enum mouse_cursor above! */
-static const struct mouse_cursor_types mouse_cursor_types[] = {
- { "text", &Vx_pointer_shape, XC_xterm },
- { "nontext", &Vx_nontext_pointer_shape, XC_left_ptr },
- { "hourglass", &Vx_hourglass_pointer_shape, XC_watch },
- { "modeline", &Vx_mode_pointer_shape, XC_xterm },
- { NULL, &Vx_sensitive_text_pointer_shape, XC_hand2 },
- { NULL, &Vx_window_horizontal_drag_shape, XC_sb_h_double_arrow },
- { NULL, &Vx_window_vertical_drag_shape, XC_sb_v_double_arrow },
- { NULL, &Vx_window_left_edge_shape, XC_left_side },
- { NULL, &Vx_window_top_left_corner_shape, XC_top_left_corner },
- { NULL, &Vx_window_top_edge_shape, XC_top_side },
- { NULL, &Vx_window_top_right_corner_shape, XC_top_right_corner },
- { NULL, &Vx_window_right_edge_shape, XC_right_side },
- { NULL, &Vx_window_bottom_right_corner_shape, XC_bottom_right_corner },
- { NULL, &Vx_window_bottom_edge_shape, XC_bottom_side },
- { NULL, &Vx_window_bottom_left_corner_shape, XC_bottom_left_corner },
-};
+static const struct mouse_cursor_types mouse_cursor_types[] =
+ {
+ { "text", &Vx_pointer_shape, XC_xterm },
+ { "nontext", &Vx_nontext_pointer_shape, XC_left_ptr },
+ { "hourglass", &Vx_hourglass_pointer_shape, XC_watch },
+ { "modeline", &Vx_mode_pointer_shape, XC_xterm },
+ { NULL, &Vx_sensitive_text_pointer_shape, XC_hand2 },
+ { NULL, &Vx_window_horizontal_drag_shape, XC_sb_h_double_arrow },
+ { NULL, &Vx_window_vertical_drag_shape, XC_sb_v_double_arrow },
+ { NULL, &Vx_window_left_edge_shape, XC_left_side },
+ { NULL, &Vx_window_top_left_corner_shape, XC_top_left_corner },
+ { NULL, &Vx_window_top_edge_shape, XC_top_side },
+ { NULL, &Vx_window_top_right_corner_shape, XC_top_right_corner },
+ { NULL, &Vx_window_right_edge_shape, XC_right_side },
+ { NULL, &Vx_window_bottom_right_corner_shape, XC_bottom_right_corner },
+ { NULL, &Vx_window_bottom_edge_shape, XC_bottom_side },
+ { NULL, &Vx_window_bottom_left_corner_shape, XC_bottom_left_corner },
+ };
-struct mouse_cursor_data {
+struct mouse_cursor_data
+{
/* Last index for which XCreateFontCursor has been called, and thus
the last index for which x_request_serial[] is valid. */
int last_cursor_create_request;
{
cursor_data.x_request_serial[i] = XNextRequest (dpy);
cursor_data.last_cursor_create_request = i;
- cursor_data.cursor[i] = XCreateFontCursor (dpy,
- cursor_data.cursor_num[i]);
+
+ cursor_data.cursor[i]
+ = x_create_font_cursor (FRAME_DISPLAY_INFO (f),
+ cursor_data.cursor_num[i]);
}
/* Now sync up and process all received errors from cursor