|
114 | 114 | (height (- (pop edges) y))
|
115 | 115 | frame-x frame-y frame-width frame-height)
|
116 | 116 | (with-current-buffer (exwm--id->buffer id)
|
| 117 | + (when tab-line-format |
| 118 | + (setq y (+ y (window-tab-line-height window)))) |
117 | 119 | (when exwm--floating-frame
|
118 | 120 | (setq frame-width (frame-pixel-width exwm--floating-frame)
|
119 | 121 | frame-height (+ (frame-pixel-height exwm--floating-frame)
|
@@ -590,6 +592,52 @@ See also `exwm-layout-enlarge-window'."
|
590 | 592 | (exwm-layout-hide-mode-line)
|
591 | 593 | (exwm-layout-show-mode-line))))
|
592 | 594 |
|
| 595 | +;;;###autoload |
| 596 | +(defun exwm-layout-hide-tab-line () |
| 597 | + "Hide tab-line." |
| 598 | + (interactive) |
| 599 | + (exwm--log) |
| 600 | + (when (and (derived-mode-p 'exwm-mode) tab-line-format) |
| 601 | + (let (tab-line-height) |
| 602 | + (when exwm--floating-frame |
| 603 | + (setq tab-line-height (window-tab-line-height |
| 604 | + (frame-root-window exwm--floating-frame)))) |
| 605 | + (setq exwm--tab-line-format tab-line-format |
| 606 | + tab-line-format nil) |
| 607 | + (if (not exwm--floating-frame) |
| 608 | + (exwm-layout--show exwm--id) |
| 609 | + (set-frame-height exwm--floating-frame |
| 610 | + (- (frame-pixel-height exwm--floating-frame) |
| 611 | + tab-line-height) |
| 612 | + nil t))))) |
| 613 | + |
| 614 | +;;;###autoload |
| 615 | +(defun exwm-layout-show-tab-line () |
| 616 | + "Show tab-line." |
| 617 | + (interactive) |
| 618 | + (exwm--log) |
| 619 | + (when (and (derived-mode-p 'exwm-mode) (not tab-line-format)) |
| 620 | + (setq tab-line-format exwm--tab-line-format |
| 621 | + exwm--tab-line-format nil) |
| 622 | + (if (not exwm--floating-frame) |
| 623 | + (exwm-layout--show exwm--id) |
| 624 | + (set-frame-height exwm--floating-frame |
| 625 | + (+ (frame-pixel-height exwm--floating-frame) |
| 626 | + (window-tab-line-height (frame-root-window |
| 627 | + exwm--floating-frame))) |
| 628 | + nil t) |
| 629 | + (call-interactively #'exwm-input-grab-keyboard)))) |
| 630 | + |
| 631 | +;;;###autoload |
| 632 | +(defun exwm-layout-toggle-tab-line () |
| 633 | + "Toggle the display of tab-line." |
| 634 | + (interactive) |
| 635 | + (exwm--log) |
| 636 | + (when (derived-mode-p 'exwm-mode) |
| 637 | + (if tab-line-format |
| 638 | + (exwm-layout-hide-tab-line) |
| 639 | + (exwm-layout-show-tab-line)))) |
| 640 | + |
593 | 641 | (defun exwm-layout--init ()
|
594 | 642 | "Initialize layout module."
|
595 | 643 | ;; Auto refresh layout
|
|
0 commit comments