From 46fe764634ff4fa0eff7ea87c3b96209a05c89be Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sun, 4 Mar 2018 12:23:37 +0800 Subject: 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. --- exwm.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'exwm.el') diff --git a/exwm.el b/exwm.el index ed251f30ad..0387426ffc 100644 --- a/exwm.el +++ b/exwm.el @@ -110,7 +110,7 @@ (interactive) (with-current-buffer (window-buffer) (when (eq major-mode 'exwm-mode) - (when (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state) + (when (exwm-layout--fullscreen-p) (exwm-layout-unset-fullscreen)) ;; Force refresh (exwm-layout--refresh) @@ -484,8 +484,7 @@ exwm--connection (make-instance 'xcb:ewmh:set-_NET_WM_STATE :window id - :data (vector - xcb:Atom:_NET_WM_STATE_FULLSCREEN))) + :data (vector xcb:Atom:_NET_WM_STATE_FULLSCREEN))) (xcb:flush exwm--connection)) (when buffer ;ensure it's managed (with-current-buffer buffer @@ -493,17 +492,14 @@ (when (or (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN props) (memq xcb:Atom:_NET_WM_STATE_ABOVE props)) (cond ((= action xcb:ewmh:_NET_WM_STATE_ADD) - (unless (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN - exwm--ewmh-state) + (unless (exwm-layout--fullscreen-p) (exwm-layout-set-fullscreen id)) (push xcb:Atom:_NET_WM_STATE_FULLSCREEN props-new)) ((= action xcb:ewmh:_NET_WM_STATE_REMOVE) - (when (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN - exwm--ewmh-state) + (when (exwm-layout--fullscreen-p) (exwm-layout-unset-fullscreen id))) ((= action xcb:ewmh:_NET_WM_STATE_TOGGLE) - (if (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN - exwm--ewmh-state) + (if (exwm-layout--fullscreen-p) (exwm-layout-unset-fullscreen id) (exwm-layout-set-fullscreen id) (push xcb:Atom:_NET_WM_STATE_FULLSCREEN props-new))))) -- cgit 1.4.1