diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2015-08-10T02·55+0800 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2015-08-10T02·55+0800 |
commit | 2d4104a0eceb7d043ed1cd6bdd1bda1db4f91a73 (patch) | |
tree | f5c4ff13d71d6d2a843e7478398822112cac272a /exwm-input.el | |
parent | edc70eb6616b818463c94b5ab8c9e3f1dfd177c9 (diff) |
Fix emacsclient bugs
`emacsclient` started with `-c` or `-t` argument create a new frame that shall not be used to manage X windows. Also fix some related input focus issues (with some remaining unfixed). Close #17.
Diffstat (limited to 'exwm-input.el')
-rw-r--r-- | exwm-input.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/exwm-input.el b/exwm-input.el index c312ff762bd5..97dfd53e3640 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -88,7 +88,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.") "Update input focus." (unless exwm-input--focus-lock (setq exwm-input--focus-lock t) - (when (eq (current-buffer) (window-buffer)) ;e.g. with-temp-buffer + (when (and (frame-parameter nil 'exwm-window-id) ;e.g. emacsclient frame + (eq (current-buffer) (window-buffer))) ;e.g. `with-temp-buffer' (if (eq major-mode 'exwm-mode) (progn (exwm--log "Set focus ID to #x%x" exwm--id) (setq exwm-input--focus-id exwm--id) @@ -163,7 +164,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.") ;; Click to focus (unless (and (boundp 'exwm--id) (= event exwm--id)) (exwm--with-current-id event - (raise-frame (or exwm--floating-frame exwm--frame)) + (select-frame-set-input-focus (or exwm--floating-frame + exwm--frame)) (select-window (get-buffer-window nil 'visible)))) ;; The event should be replayed (setq mode xcb:Allow:ReplayPointer)))) |