The parameters described below provide support for resizing a frame by
dragging its internal borders with the mouse. They also allow moving a
-frame with the mouse by dragging the header line of its topmost or the
-mode line of its bottommost window.
+frame with the mouse by dragging the header or tab line of its topmost
+or the mode line of its bottommost window.
These parameters are mostly useful for child frames (@pxref{Child
Frames}) that come without window manager decorations. If necessary,
If non-@code{nil}, the frame can be moved with the mouse by dragging the
header line of its topmost window.
+@vindex drag-with-tab-line@r{, a frame parameter}
+@item drag-with-tab-line
+If non-@code{nil}, the frame can be moved with the mouse by dragging the
+tab line of its topmost window.
+
@vindex drag-with-mode-line@r{, a frame parameter}
@item drag-with-mode-line
If non-@code{nil}, the frame can be moved with the mouse by dragging the
emulators by using the new input-meta-mode with the special value
'encoded' with these terminal emulators.
++++
+** New frame parameter 'drag-with-tab-line'.
+This parameter, similar to 'drag-with-header-line', allows moving frames
+by dragging the tab lines of their topmost windows with the mouse.
\f
* Editing Changes in Emacs 28.1
(when (frame-parameter frame 'drag-with-header-line)
(mouse-drag-frame-move start-event))))))
+(defun mouse-drag-tab-line (start-event)
+ "Drag frame with tab line in its topmost window.
+START-EVENT is the starting mouse event of the drag action."
+ (interactive "e")
+ (let* ((start (event-start start-event))
+ (window (posn-window start)))
+ (when (and (window-live-p window)
+ (window-at-side-p window 'top))
+ (let ((frame (window-frame window)))
+ (when (frame-parameter frame 'drag-with-tab-line)
+ (mouse-drag-frame-move start-event))))))
+
(defun mouse-drag-vertical-line (start-event)
"Change the width of a window by dragging on a vertical line.
START-EVENT is the starting mouse event of the drag action."
;; with a mode-line, header-line or vertical-line prefix ...
(define-key map [mode-line] map)
(define-key map [header-line] map)
+ (define-key map [tab-line] map)
(define-key map [vertical-line] map)
;; ... and some maybe even with a right- or bottom-divider
;; prefix.
;; with a mode-line, header-line or vertical-line prefix ...
(define-key map [mode-line] map)
(define-key map [header-line] map)
+ (define-key map [tab-line] map)
(define-key map [vertical-line] map)
;; ... and some maybe even with a right- or bottom-divider
;; prefix.
;; versions.
(global-set-key [header-line down-mouse-1] 'mouse-drag-header-line)
(global-set-key [header-line mouse-1] 'mouse-select-window)
+(global-set-key [tab-line down-mouse-1] 'mouse-drag-tab-line)
(global-set-key [tab-line mouse-1] 'mouse-select-window)
;; (global-set-key [mode-line drag-mouse-1] 'mouse-select-window)
(global-set-key [mode-line down-mouse-1] 'mouse-drag-mode-line)