about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 871438f9f6e0..df603f709a12 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -392,6 +392,39 @@ See also `exwm-layout-enlarge-window'."
   (interactive "p")
   (exwm-layout-enlarge-window (- delta) t))
 
+(defun exwm-layout-hide-mode-line ()
+  "Hide mode-line."
+  (interactive)
+  (when (and (eq major-mode 'exwm-mode) mode-line-format)
+    (setq exwm--mode-line-format mode-line-format
+          mode-line-format nil)
+    (if (not exwm--floating-frame)
+        (exwm-layout--show exwm--id)
+      (exwm-floating--fit-frame-to-window)
+      (xcb:flush exwm--connection)
+      (setq window-size-fixed exwm--fixed-size))))
+
+(defun exwm-layout-show-mode-line ()
+  "Show mode-line."
+  (interactive)
+  (when (and (eq major-mode 'exwm-mode) (not mode-line-format))
+    (setq mode-line-format exwm--mode-line-format
+          exwm--mode-line-format nil)
+    (if (not exwm--floating-frame)
+        (exwm-layout--show exwm--id)
+      (exwm-floating--fit-frame-to-window)
+      (exwm-input-grab-keyboard)
+      (xcb:flush exwm--connection)
+      (setq window-size-fixed exwm--fixed-size))))
+
+(defun exwm-layout-toggle-mode-line ()
+  "Toggle the display of mode-line."
+  (interactive)
+  (when (eq major-mode 'exwm-mode)
+    (if mode-line-format
+        (exwm-layout-hide-mode-line)
+      (exwm-layout-show-mode-line))))
+
 (defun exwm-layout--init ()
   "Initialize layout module."
   ;; Auto refresh layout