emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm 5a39c5c 1/2: Allow user to hide floating X windows


From: Chris Feng
Subject: [elpa] externals/exwm 5a39c5c 1/2: Allow user to hide floating X windows
Date: Thu, 25 Feb 2016 04:44:04 +0000

branch: externals/exwm
commit 5a39c5c2fad643a656c59c0071f0cbea58eb65a9
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    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.
---
 exwm-core.el      |    1 +
 exwm-floating.el  |   16 ++++++++++++++++
 exwm-workspace.el |    2 +-
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/exwm-core.el b/exwm-core.el
index 5377c67..e202d4e 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -121,6 +121,7 @@
 (defvar exwm-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map "\C-c\C-f" #'exwm-layout-set-fullscreen)
+    (define-key map "\C-c\C-h" #'exwm-floating-hide)
     (define-key map "\C-c\C-k" #'exwm-input-release-keyboard)
     (define-key map "\C-c\C-m" #'exwm-workspace-move-window)
     (define-key map "\C-c\C-q" #'exwm-input-send-next-key)
diff --git a/exwm-floating.el b/exwm-floating.el
index 4577053..ba162f6 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
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 4af98fb..80767d5 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -232,7 +232,7 @@ The optional FORCE option is for internal use only."
 (defvar exwm-floating-border-width)
 (defvar exwm-floating-border-color)
 
-(declare-function exwm-layout--show "exwm-layout.el" (id))
+(declare-function exwm-layout--show "exwm-layout.el" (id &optional window))
 (declare-function exwm-layout--hide "exwm-layout.el" (id))
 (declare-function exwm-layout--refresh "exwm-layout.el")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]