about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-08-24T11·21+0800
committerChris Feng <chris.w.feng@gmail.com>2016-08-24T11·21+0800
commita9136213020efb69672996e2306ae8c26b14e629 (patch)
tree023a42f31784c760b0fa4a08b58955f134587cbe /exwm-layout.el
parentcb75d4814daac2f6d52d11550199be65d185f996 (diff)
Add toggle commands
* exwm-input.el (exwm-input-toggle-keyboard): New command for toggling
keyboard mode.
* exwm-layout.el (exwm-layout-toggle-fullscreen): New command for
toggling fullscreen mode.
* exwm-core.el (exwm-mode-menu, exwm-mode-map): Use them.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index e8fd8e50c706..355b8346504c 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -260,6 +260,16 @@
           (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
     (call-interactively #'exwm-input-grab-keyboard)))
 
+;;;###autoload
+(defun exwm-layout-toggle-fullscreen (&optional id)
+  "Toggle fullscreen mode."
+  (interactive (list (exwm--buffer->id (window-buffer))))
+  (when id
+    (with-current-buffer (exwm--id->buffer id)
+      (if (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)
+          (exwm-reset)
+        (exwm-layout-set-fullscreen id)))))
+
 (defvar exwm-layout--other-buffer-exclude-exwm-mode-buffers nil
   "When non-nil, prevent EXWM buffers from being selected by `other-buffer'.")