(string-to-number (string-replace "tab-" "" key-name)))))
(t t)))
+(defvar tab-bar-drag-maybe)
+
(defun tab-bar--event-to-item (posn)
"This function extracts extra info from the mouse event POSN.
It returns a list that contains three elements: a key,
a key binding, and a boolean value whether the close button \"+\"
was clicked."
+ (setq tab-bar-drag-maybe nil)
(if (posn-window posn)
(let ((caption (car (posn-string posn))))
(when caption
(interactive "e")
(let* ((item (tab-bar--event-to-item (event-start event)))
(tab-number (tab-bar--key-to-number (nth 0 item))))
+ (setq tab-bar-drag-maybe t)
;; Don't close the tab when clicked on the close button. Also
;; don't add new tab on down-mouse. Let `tab-bar-mouse-1' do this.
(unless (or (eq (car item) 'add-tab) (nth 2 item))
This command should be bound to a drag event. It moves the tab
at the mouse-down event to the position at mouse-up event."
(interactive "e")
+ (setq tab-bar-drag-maybe nil)
(let ((from (tab-bar--key-to-number
(nth 0 (tab-bar--event-to-item
(event-start event)))))
if (EQ (window, f->tab_bar_window))
{
note_tab_bar_highlight (f, x, y);
- return;
+ if (tab_bar_drag_maybe)
+ {
+ cursor = FRAME_OUTPUT_DATA (f)->hand_cursor;
+ goto set_cursor;
+ }
+ else
+ return;
}
#endif
mouse stays within the extent of a single glyph (except for images). */);
mouse_fine_grained_tracking = false;
+ DEFVAR_BOOL ("tab-bar-drag-maybe", tab_bar_drag_maybe,
+ doc: /* Non-nil when maybe dragging tab bar item. */);
+ tab_bar_drag_maybe = false;
+
DEFVAR_BOOL ("redisplay-skip-initial-frame", redisplay_skip_initial_frame,
doc: /* Non-nil to skip redisplay in initial frame.
The initial frame is not displayed anywhere, so skipping it is