about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-08-12T11·27+0800
committerChris Feng <chris.w.feng@gmail.com>2016-08-12T11·27+0800
commitebcc9591f3c1210efda007bec6852369b75fa8ad (patch)
tree1729d150e042581df4999aa9e0a14bcbc96e127d /exwm.el
parente4ecd792103c33e03ef9ff590d9c8e6b86431efd (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.el')
-rw-r--r--exwm.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/exwm.el b/exwm.el
index 0bc9701c0317..0544308bfed2 100644
--- a/exwm.el
+++ b/exwm.el
@@ -78,7 +78,8 @@
   (interactive)
   (with-current-buffer (window-buffer)
     (when (eq major-mode 'exwm-mode)
-      (when exwm--fullscreen (exwm-layout-unset-fullscreen))
+      (when (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)
+        (exwm-layout-unset-fullscreen))
       ;; Force refresh
       (exwm-layout--refresh)
       (call-interactively #'exwm-input-grab-keyboard))))
@@ -464,12 +465,17 @@
             (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 exwm--fullscreen (exwm-layout-set-fullscreen id))
+                     (unless (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN
+                                   exwm--ewmh-state)
+                       (exwm-layout-set-fullscreen id))
                      (push xcb:Atom:_NET_WM_STATE_FULLSCREEN props-new))
                     ((= action xcb:ewmh:_NET_WM_STATE_REMOVE)
-                     (when exwm--fullscreen (exwm-layout-unset-fullscreen id)))
+                     (when (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN
+                                 exwm--ewmh-state)
+                       (exwm-layout-unset-fullscreen id)))
                     ((= action xcb:ewmh:_NET_WM_STATE_TOGGLE)
-                     (if exwm--fullscreen
+                     (if (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN
+                               exwm--ewmh-state)
                          (exwm-layout-unset-fullscreen id)
                        (exwm-layout-set-fullscreen id)
                        (push xcb:Atom:_NET_WM_STATE_FULLSCREEN props-new)))))