Postpone making workspace frames fullscreen

* exwm-workspace.el (exwm-workspace--init, exwm-workspace--post-init): Move
work to postpone to the new function `exwm-workspace--post-init'.

* exwm.el (exwm-init): Call `exwm-workspace--post-init' after
`exwm--unlock`.
This commit is contained in:
Chris Feng 2016-02-12 14:10:11 +08:00
parent 35d04c3468
commit ea027d424e
2 changed files with 9 additions and 5 deletions

View file

@ -599,11 +599,6 @@ This functions is modified from `display-buffer-reuse-window' and
(xcb:flush exwm--connection) (xcb:flush exwm--connection)
;; We have to advice `x-create-frame' or every call to it would hang EXWM ;; We have to advice `x-create-frame' or every call to it would hang EXWM
(advice-add 'x-create-frame :around #'exwm-workspace--x-create-frame) (advice-add 'x-create-frame :around #'exwm-workspace--x-create-frame)
;; Delay making the workspaces fullscreen until Emacs becomes idle
(run-with-idle-timer 0 nil
(lambda ()
(dolist (i exwm-workspace--list)
(set-frame-parameter i 'fullscreen 'fullboth))))
;; Set _NET_VIRTUAL_ROOTS ;; Set _NET_VIRTUAL_ROOTS
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_VIRTUAL_ROOTS (make-instance 'xcb:ewmh:set-_NET_VIRTUAL_ROOTS
@ -615,6 +610,14 @@ This functions is modified from `display-buffer-reuse-window' and
;; Switch to the first workspace ;; Switch to the first workspace
(exwm-workspace-switch 0 t)) (exwm-workspace-switch 0 t))
(defun exwm-workspace--post-init ()
"The second stage in the initialization of the workspace module."
;; Delay making the workspaces fullscreen until Emacs becomes idle
(run-with-idle-timer 0 nil
(lambda ()
(dolist (i exwm-workspace--list)
(set-frame-parameter i 'fullscreen 'fullboth)))))
(provide 'exwm-workspace) (provide 'exwm-workspace)

View file

@ -517,6 +517,7 @@
(exwm-workspace--init) (exwm-workspace--init)
(exwm-input--init) (exwm-input--init)
(exwm--unlock) (exwm--unlock)
(exwm-workspace--post-init)
;; Manage existing windows ;; Manage existing windows
(exwm-manage--scan) (exwm-manage--scan)
(run-hooks 'exwm-init-hook))))) (run-hooks 'exwm-init-hook)))))