about summary refs log tree commit diff
path: root/exwm-floating.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-02-25T04·41+0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-25T04·41+0800
commit5a39c5c2fad643a656c59c0071f0cbea58eb65a9 (patch)
treeaf24cdcbef91cc0bd08fcf65696a048aea1353cb /exwm-floating.el
parentdb6d26c662a750b273e1bbc06902a2a46e101e4c (diff)
Allow user to hide floating X windows
* exwm-core.el (exwm-mode-map): Add a new key to hide floating X windows.
* exwm-floating.el (exwm-floating-hide): New command to hide a floating X
window.

* exwm-workspace.el: Fix a compile warning.
Diffstat (limited to 'exwm-floating.el')
-rw-r--r--exwm-floating.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/exwm-floating.el b/exwm-floating.el
index 457705322ccd..ba162f67e12b 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -284,6 +284,22 @@
         (exwm-floating--unset-floating exwm--id)
       (exwm-floating--set-floating exwm--id))))
 
+;;;###autoload
+(defun exwm-floating-hide ()
+  "Hide the current floating X window (which would show again when selected)."
+  (interactive)
+  (when (and (eq major-mode 'exwm-mode)
+             exwm--floating-frame)
+    ;; Put this floating X window at bottom.
+    (xcb:+request exwm--connection
+        (make-instance 'xcb:ConfigureWindow
+                       :window exwm--container
+                       :value-mask xcb:ConfigWindow:StackMode
+                       :stack-mode xcb:StackMode:Below))
+    ;; FIXME: Should it be put into iconic state?
+    (xcb:flush exwm--connection)
+    (select-frame-set-input-focus exwm-workspace--current)))
+
 (define-obsolete-function-alias 'exwm-floating-hide-mode-line
   'exwm-layout-hide-mode-line "25.1" "Hide mode-line of a floating frame.")
 (define-obsolete-function-alias 'exwm-floating-show-mode-line