about summary refs log tree commit diff
path: root/exwm-manage.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-11-24T14·43+0800
committerChris Feng <chris.w.feng@gmail.com>2017-11-24T14·43+0800
commit589b84040980504f0de7d80771b4ccfd63af4eef (patch)
treed7191b9e1ff3d38e1cf3e41de861b6ba5bcfbaed /exwm-manage.el
parent71a39840b239a51eed7455877517ebe612892eff (diff)
Fix possible wrong context when killing buffers
* exwm-manage.el (exwm-manage--unmanage-window): Make sure to use the
correct context to read/set buffer-local variables when killing
buffers.
Diffstat (limited to 'exwm-manage.el')
-rw-r--r--exwm-manage.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/exwm-manage.el b/exwm-manage.el
index 2b964756351c..d61a55a58cf7 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -405,11 +405,12 @@ manager is shutting down."
         (xcb:flush exwm--connection))
       (let ((kill-buffer-func
              (lambda (buffer)
-               (let ((kill-buffer-query-functions nil))
-                 (when exwm--floating-frame
-                   (select-window
-                    (frame-selected-window exwm-workspace--current)))
-                 (kill-buffer buffer)))))
+               (when (buffer-local-value 'exwm--floating-frame buffer)
+                 (select-window
+                  (frame-selected-window exwm-workspace--current)))
+               (with-current-buffer buffer
+                 (let ((kill-buffer-query-functions nil))
+                   (kill-buffer buffer))))))
         (exwm--defer 0 kill-buffer-func buffer)
         (when (active-minibuffer-window)
           (exit-minibuffer))))))