about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-30T02·00+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-30T02·00+0800
commit6bfedf8bf71ef11a26f2e8c3cddbac55ce873e5c (patch)
treec3f076b82c269e2b02d813c5a199aab49b0cbfe9 /exwm-workspace.el
parentf52848595d44064bb092d3028a7f9afe1107faf1 (diff)
Fix input focus transfer between workspaces
* exwm-input.el (exwm-input--set-focus): Make input focus revert to
parent by default (to prevent input focus from following pointer).

* exwm-input.el (exwm-input--update-focus): Switch to another workspace
if input focus is transfered to it.
* exwm-workspace.el (exwm-workspace--on-focus-in, exwm-workspace--init)
(exwm-workspace--exit): Remove `exwm-workspace--on-focus-in' and related
uses.
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el13
1 files changed, 0 insertions, 13 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 3a4a5a8ef66c..b2a0cab153e1 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -610,16 +610,6 @@ INDEX must not exceed the current number of workspaces."
          (exwm-workspace--workspace-from-frame-or-index frame-or-index)
        exwm-workspace--current))))
 
-(defun exwm-workspace--on-focus-in ()
-  "Handle unexpected frame switch."
-  ;; `focus-in-hook' is run by `handle-switch-frame'.
-  (unless (eq this-command #'handle-switch-frame)
-    (let ((index (exwm-workspace--position (selected-frame))))
-      (exwm--log "Focus on workspace %s" index)
-      (when (and index (/= index exwm-workspace-current-index))
-        (exwm--log "Workspace was switched unexpectedly")
-        (exwm-workspace-switch index)))))
-
 (defun exwm-workspace--set-desktop (id)
   "Set _NET_WM_DESKTOP for X window ID."
   (with-current-buffer (exwm--id->buffer id)
@@ -1374,8 +1364,6 @@ applied to all subsequently created X frames."
       ;; `minibuffer-completion-help') is not correct here.
       (cl-pushnew '(exwm-workspace--display-buffer) display-buffer-alist
                   :test #'equal))
-    ;; Handle unexpected frame switch.
-    (add-hook 'focus-in-hook #'exwm-workspace--on-focus-in)
     ;; Prevent `other-buffer' from selecting already displayed EXWM buffers.
     (modify-all-frames-parameters
      '((buffer-predicate . exwm-layout--other-buffer-predicate)))
@@ -1413,7 +1401,6 @@ applied to all subsequently created X frames."
   (setq display-buffer-alist
         (cl-delete '(exwm-workspace--display-buffer) display-buffer-alist
                    :test #'equal))
-  (remove-hook 'focus-in-hook #'exwm-workspace--on-focus-in)
   (advice-remove 'x-create-frame #'exwm-workspace--x-create-frame)
   (remove-hook 'after-make-frame-functions
                #'exwm-workspace--add-frame-as-workspace)