about summary refs log tree commit diff
path: root/exwm-core.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-core.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-core.el')
-rw-r--r--exwm-core.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/exwm-core.el b/exwm-core.el
index 226e7fc312f3..0c92d903394d 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -87,7 +87,6 @@
 (defvar-local exwm--frame nil)            ;workspace frame
 (defvar-local exwm--floating-frame nil)   ;floating frame
 (defvar-local exwm--mode-line-format nil) ;save mode-line-format
-(defvar-local exwm--fullscreen nil)       ;used in fullscreen
 (defvar-local exwm--floating-frame-position nil) ;used in fullscreen
 (defvar-local exwm--fixed-size nil)              ;fixed size
 (defvar-local exwm--keyboard-grabbed nil)        ;Keyboard grabbed.
@@ -103,6 +102,7 @@
 (defvar-local exwm-transient-for nil "WM_TRANSIENT_FOR.")
 (defvar-local exwm--protocols nil)
 (defvar-local exwm-state xcb:icccm:WM_STATE:NormalState "WM_STATE.")
+(defvar-local exwm--ewmh-state nil "_NET_WM_STATE.")
 ;; _NET_WM_NORMAL_HINTS
 (defvar-local exwm--normal-hints-x nil)
 (defvar-local exwm--normal-hints-y nil)
@@ -150,8 +150,10 @@
     "*General*"
     "---"
     ["Toggle floating" exwm-floating-toggle-floating]
-    ["Enter fullscreen" exwm-layout-set-fullscreen (not exwm--fullscreen)]
-    ["Leave fullscreen" exwm-reset exwm--fullscreen]
+    ["Enter fullscreen" exwm-layout-set-fullscreen
+     (null (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))]
+    ["Leave fullscreen" exwm-reset
+     (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)]
     ["Hide window" exwm-floating-hide exwm--floating-frame]
 
     "---"