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.
This commit is contained in:
Chris Feng 2015-08-10 10:55:28 +08:00
parent edc70eb661
commit 2d4104a0ec
4 changed files with 49 additions and 33 deletions

View file

@ -195,6 +195,9 @@
(defun exwm-reset ()
"Reset window to standard state: non-fullscreen, line-mode."
(interactive)
(unless (frame-parameter nil 'exwm-window-id)
;; Move focus away form a non-EXWM frame
(x-focus-frame exwm-workspace--current))
(with-current-buffer (window-buffer)
(when (eq major-mode 'exwm-mode)
(when exwm--fullscreen (exwm-layout-unset-fullscreen))
@ -400,7 +403,8 @@
(exwm--update-state id t))
((= atom xcb:Atom:_NET_WM_USER_TIME)) ;ignored
(t (exwm--log "Unhandled PropertyNotify: %s(%d)"
(x-get-atom-name atom) atom)))))))
(x-get-atom-name atom exwm-workspace--current)
atom)))))))
(defun exwm--on-ClientMessage (raw-data synthetic)
"Handle ClientMessage event."
@ -628,9 +632,6 @@
(exwm-input--init)
(exwm-randr--init)
(exwm--unlock)
;; Disable events during new frame creation
(add-hook 'before-make-frame-hook 'exwm--lock)
(add-hook 'after-make-frame-functions 'exwm--unlock)
;; Manage exiting windows
(exwm-manage--scan)
(run-hooks 'exwm-init-hook)))))