Fix fullscreen mode after switching workspace and back

* exwm-layout.el (exwm-layout--show): Always set an X window in
fullscreen mode the size in fullscreen.
(exwm-layout-unset-fullscreen): Leave the fullscreen mode first.

* exwm-layout.el (exwm-layout--fullscreen-p): New function telling
whether the current buffer is in fullscreen mode.
(exwm-layout-set-fullscreen, exwm-layout-unset-fullscreen)
(exwm-layout-toggle-fullscreen):
* exwm-manage.el (exwm-manage--manage-window)
(exwm-manage--on-ConfigureRequest):
* exwm-workspace.el (exwm-workspace-switch, exwm-workspace-swap)
(exwm-workspace-move):
* exwm.el (exwm-reset, exwm--on-ClientMessage): Use it.
This commit is contained in:
Chris Feng 2018-03-04 12:23:37 +08:00
parent 277377c718
commit 46fe764634
4 changed files with 32 additions and 20 deletions

View file

@ -128,6 +128,7 @@ Please manually run the hook `exwm-workspace-list-change-hook' afterwards.")
(defvar exwm-manage--desktop)
(declare-function exwm--exit "exwm.el")
(declare-function exwm-input--on-buffer-list-update "exwm-input.el" ())
(declare-function exwm-layout--fullscreen-p "exwm-layout.el" ())
(declare-function exwm-layout--hide "exwm-layout.el" (id))
(declare-function exwm-layout--other-buffer-predicate "exwm-layout.el"
(buffer))
@ -504,7 +505,7 @@ for internal use only."
((null current-prefix-arg)
(unless (and (eq major-mode 'exwm-mode)
;; The prompt is invisible in fullscreen mode.
(memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
(exwm-layout--fullscreen-p))
(let ((exwm-workspace--prompt-add-allowed t)
(exwm-workspace--prompt-delete-allowed t))
(exwm-workspace--prompt-for-workspace "Switch to [+/-]: "))))
@ -631,7 +632,7 @@ Passing a workspace frame as the first option is for internal use only."
(interactive
(unless (and (eq major-mode 'exwm-mode)
;; The prompt is invisible in fullscreen mode.
(memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
(exwm-layout--fullscreen-p))
(let (w1 w2)
(let ((exwm-workspace--prompt-add-allowed t)
(exwm-workspace--prompt-delete-allowed t))
@ -671,7 +672,7 @@ before it."
((null current-prefix-arg)
(unless (and (eq major-mode 'exwm-mode)
;; The prompt is invisible in fullscreen mode.
(memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
(exwm-layout--fullscreen-p))
(list exwm-workspace--current
(exwm-workspace--position
(exwm-workspace--prompt-for-workspace "Move workspace to: ")))))