From 6e0b944c2de14fe67d292f3351bf4353f7b846d8 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Tue, 9 Aug 2016 13:20:36 +0800 Subject: [PATCH] Ensure floating hooks are run in the right context * exwm-floating.el (exwm-floating-setup-hook, exwm-floating-exit-hook): Fix doc string. (exwm-floating--set-floating, exwm-floating--unset-floating): Set the context. --- exwm-floating.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/exwm-floating.el b/exwm-floating.el index 6702e38..464dd20 100644 --- a/exwm-floating.el +++ b/exwm-floating.el @@ -34,9 +34,11 @@ "Border color of the floating window.") (defvar exwm-floating-setup-hook nil - "Normal hook run when a window has been made floating.") + "Normal hook run when an X window has been made floating, in the +context of the corresponding buffer.") (defvar exwm-floating-exit-hook nil - "Normal hook run when a window has exited floating state.") + "Normal hook run when an X window has exited floating state, in the +context of the corresponding buffer.") ;; Cursors for moving/resizing a window (defvar exwm-floating--cursor-move nil) @@ -252,7 +254,8 @@ xcb:ConfigWindow:Y) :x 0 :y 0)) (xcb:flush exwm--connection))) - (run-hooks 'exwm-floating-setup-hook) + (with-current-buffer (exwm--id->buffer id) + (run-hooks 'exwm-floating-setup-hook)) ;; Redraw the frame. (redisplay)) @@ -324,7 +327,8 @@ (let ((window (frame-selected-window exwm-workspace--current))) (set-window-buffer window buffer) (select-window window)))) - (run-hooks 'exwm-floating-exit-hook)) + (with-current-buffer (exwm--id->buffer id) + (run-hooks 'exwm-floating-exit-hook))) ;;;###autoload (defun exwm-floating-toggle-floating ()