From 2d4104a0eceb7d043ed1cd6bdd1bda1db4f91a73 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Mon, 10 Aug 2015 10:55:28 +0800 Subject: 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. --- exwm-input.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'exwm-input.el') diff --git a/exwm-input.el b/exwm-input.el index c312ff762b..97dfd53e36 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)))) -- cgit 1.4.1