branch: externals/exwm
commit dae97fa4bbe92ce874d27295c79b7febb633530e
Author: Steven Allen <[email protected]>
Commit: Steven Allen <[email protected]>

    Correctly minimize unselected windows
    
    Previously, we'd simply call `bury-buffer' with the target buffer
    selected. However, `bury-buffer' only replaces the buffer in the current
    window.
    
    * exwm.el (exwm--on-wm-change-state): Replace minimized buffers in all
    windows.  (Bug #159)
---
 exwm.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/exwm.el b/exwm.el
index aed8644529..64399ef32b 100644
--- a/exwm.el
+++ b/exwm.el
@@ -649,7 +649,12 @@ DATA contains unmarshalled PropertyNotify event data."
       (with-current-buffer buffer
         (if exwm--floating-frame
             (call-interactively #'exwm-floating-hide)
-          (bury-buffer))))))
+          ;; We can't simply bury the buffer because it may be in an unselected
+          ;; window, or even a different frame/workspace.
+          (replace-buffer-in-windows))
+        ;; We bury the buffer even if it's floating to ensure it goes to the
+        ;; back of the buffer switch list.
+        (bury-buffer)))))
 
 (defun exwm--on-ClientMessage (raw-data _synthetic)
   "Handle ClientMessage event.

Reply via email to