diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2016-08-12T11·27+0800 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2016-08-12T11·27+0800 |
commit | ebcc9591f3c1210efda007bec6852369b75fa8ad (patch) | |
tree | 1729d150e042581df4999aa9e0a14bcbc96e127d /exwm-layout.el | |
parent | e4ecd792103c33e03ef9ff590d9c8e6b86431efd (diff) |
Check for _NET_WM_STATE_FULLSCREEN on managing
* exwm-core.el (exwm--fullscreen): Removed. (exwm--ewmh-state): New variable for recording the _NET_WM_STATE hint. * exwm-core.el (exwm-mode-menu, exwm-mode-map): * exwm-layout.el (exwm-layout-set-fullscreen) (exwm-layout-unset-fullscreen): * exwm-manage.el (exwm-manage--unmanage-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 the new variable. * exwm-manage.el (exwm-manage--update-ewmh-state): New function for updating _NET_WM_STATE. (exwm-manage--manage-window): Update _NET_WM_STATE and check for _NET_WM_STATE_FULLSCREEN.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r-- | exwm-layout.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/exwm-layout.el b/exwm-layout.el index f5e0e149e957..e8fd8e50c706 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -177,7 +177,7 @@ "Make window ID fullscreen." (interactive) (with-current-buffer (if id (exwm--id->buffer id) (window-buffer)) - (when exwm--fullscreen + (when (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state) (user-error "Already in full-screen mode.")) ;; Save the position of floating frame. (when exwm--floating-frame @@ -221,7 +221,7 @@ :window exwm--id :data (vector xcb:Atom:_NET_WM_STATE_FULLSCREEN))) (xcb:flush exwm--connection) - (setq exwm--fullscreen t) + (cl-pushnew xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state) (call-interactively #'exwm-input-release-keyboard))) ;;;###autoload @@ -229,7 +229,7 @@ "Restore window from fullscreen state." (interactive) (with-current-buffer (if id (exwm--id->buffer id) (window-buffer)) - (unless exwm--fullscreen + (unless (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state) (user-error "Not in full-screen mode.")) ;; Restore the size of this workspace. (exwm-workspace--set-fullscreen exwm--frame) @@ -256,7 +256,8 @@ (xcb:+request exwm--connection (make-instance 'xcb:ewmh:set-_NET_WM_STATE :window exwm--id :data [])) (xcb:flush exwm--connection) - (setq exwm--fullscreen nil) + (setq exwm--ewmh-state + (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)) (call-interactively #'exwm-input-grab-keyboard))) (defvar exwm-layout--other-buffer-exclude-exwm-mode-buffers nil |