about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-09-23T10·24+0800
committerChris Feng <chris.w.feng@gmail.com>2016-09-23T10·24+0800
commit84dad20d6648638443bc7c731d7d60bbf0872bdb (patch)
tree18ec7cfb05a6f038c7ee95463e043d9f7ed63cd1 /exwm-input.el
parentf96f565d548521a87e0f3a23bfab7f5b836e4640 (diff)
Allow selecting an X window from another workspace
* exwm-input.el (exwm-input--on-buffer-list-update): Filter out
switch-frame events.
(exwm-input--update-focus): Switch workspace to set input focus on an X
window from another workspace.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el10
1 files changed, 2 insertions, 8 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 8101cbd52882..b956f5c663dd 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -160,6 +160,7 @@ This value should always be overwritten.")
   "Run in `buffer-list-update-hook' to track input focus."
   (when (and (not (minibufferp)) ;Do not set input focus on minibuffer window.
              (eq (current-buffer) (window-buffer)) ;e.g. `with-temp-buffer'.
+             (not (eq this-command #'handle-switch-frame))
              (not (exwm-workspace--client-p)))
     (setq exwm-input--update-focus-window (selected-window))
     (exwm-input--update-focus-defer)))
@@ -214,14 +215,7 @@ This value should always be overwritten.")
     (with-current-buffer (window-buffer window)
       (if (eq major-mode 'exwm-mode)
           (if (not (eq exwm--frame exwm-workspace--current))
-              ;; Do not focus X windows on other workspace.
-              (progn
-                (set-frame-parameter exwm--frame 'exwm-urgency t)
-                (setq exwm-workspace--switch-history-outdated t)
-                (force-mode-line-update)
-                ;; The application may have changed its input focus
-                (select-window
-                 (frame-selected-window exwm-workspace--current)))
+              (exwm-workspace-switch exwm--frame)
             (exwm--log "Set focus on #x%x" exwm--id)
             (exwm-input--set-focus exwm--id)
             (when exwm--floating-frame