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

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

[elpa] externals/exwm c579476: Fix `after-focus-change-function' not wor


From: Chris Feng
Subject: [elpa] externals/exwm c579476: Fix `after-focus-change-function' not working
Date: Sun, 28 Jul 2019 05:08:27 -0400 (EDT)

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

    Fix `after-focus-change-function' not working
    
    * exwm-workspace.el (exwm-workspace--original-handle-focus-in)
    (exwm-workspace--original-handle-focus-out): Store the original
    `handle-focus-{in,out}'.
    (exwm-workspace-switch): Now that `handle-focus-{in,out}' has been
    updated to call other stuffs like `after-focus-change-function', we
    can no longer run `focus-{in,out}-hook' only.
---
 exwm-workspace.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index 183d91a..a4ccc2f 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -106,6 +106,11 @@ Please manually run the hook 
`exwm-workspace-list-change-hook' afterwards.")
 (defvar exwm-workspace--minibuffer nil
   "The minibuffer frame shared among all frames.")
 
+(defvar exwm-workspace--original-handle-focus-in
+  (symbol-function #'handle-focus-in))
+(defvar exwm-workspace--original-handle-focus-out
+  (symbol-function #'handle-focus-out))
+
 (defvar exwm-workspace--prompt-add-allowed nil
   "Non-nil to allow adding workspace from the prompt.")
 
@@ -648,8 +653,9 @@ for internal use only."
     (when (and (not (eq frame old-frame))
                (frame-live-p old-frame))
       (with-selected-frame old-frame
-        (run-hooks 'focus-out-hook)))
-    (run-hooks 'focus-in-hook)
+        (funcall exwm-workspace--original-handle-focus-out
+                 (list 'focus-out frame))))
+    (funcall exwm-workspace--original-handle-focus-in (list 'focus-in frame))
     (run-hooks 'exwm-workspace-switch-hook)))
 
 ;;;###autoload



reply via email to

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