Minor fixes for emacsclient

This commit is contained in:
Chris Feng 2015-08-13 07:54:19 +08:00
parent 04e4269617
commit 35560a49d6
2 changed files with 5 additions and 5 deletions

View file

@ -175,8 +175,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
;; Resize ;; Resize
(exwm-floating--start-moveresize event)) (exwm-floating--start-moveresize event))
(t (t
(select-window (get-buffer-window (exwm--id->buffer event) ;; Click to focus
'visible)) (select-window (get-buffer-window (exwm--id->buffer event) t))
;; The event should be replayed ;; The event should be replayed
(setq mode xcb:Allow:ReplayPointer)))) (setq mode xcb:Allow:ReplayPointer))))
(xcb:+request exwm--connection (xcb:+request exwm--connection

View file

@ -590,6 +590,7 @@
(if (not (eq 'x (framep (or frame (selected-frame))))) (if (not (eq 'x (framep (or frame (selected-frame)))))
(exwm--log "Not running under X environment") (exwm--log "Not running under X environment")
(unless exwm--connection (unless exwm--connection
(exwm-enable 'undo) ;never initialize again
(setq exwm--connection (xcb:connect-to-socket)) (setq exwm--connection (xcb:connect-to-socket))
(set-process-query-on-exit-flag (slot-value exwm--connection 'process) (set-process-query-on-exit-flag (slot-value exwm--connection 'process)
nil) ;prevent query message on exit nil) ;prevent query message on exit
@ -604,7 +605,6 @@
;; Other window manager is running ;; Other window manager is running
(progn (xcb:disconnect exwm--connection) (progn (xcb:disconnect exwm--connection)
(setq exwm--connection nil) (setq exwm--connection nil)
(exwm-enable 'undo)
(exwm--log "Other window manager detected")) (exwm--log "Other window manager detected"))
;; Initialize ICCCM/EWMH support ;; Initialize ICCCM/EWMH support
;; (xcb:icccm:init exwm--connection) ;; (xcb:icccm:init exwm--connection)
@ -694,10 +694,10 @@
(defun exwm-enable (&optional undo) (defun exwm-enable (&optional undo)
"Enable/Disable EXWM" "Enable/Disable EXWM"
(setq frame-resize-pixelwise t) ;mandatory; before init
(if (eq undo 'undo) (if (eq undo 'undo)
(progn (remove-hook 'window-setup-hook 'exwm-init) (progn (remove-hook 'window-setup-hook 'exwm-init)
(remove-hook 'after-make-frame-functions 'exwm-init)) (remove-hook 'after-make-frame-functions 'exwm-init))
(setq frame-resize-pixelwise t) ;mandatory; before init
(add-hook 'window-setup-hook 'exwm-init t) ;for Emacs (add-hook 'window-setup-hook 'exwm-init t) ;for Emacs
(add-hook 'after-make-frame-functions 'exwm-init t))) ;for Emacs Client (add-hook 'after-make-frame-functions 'exwm-init t))) ;for Emacs Client