about summary refs log tree commit diff
path: root/exwm-workspace.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-workspace.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-workspace.el')
-rw-r--r--exwm-workspace.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index fec83d9147e1..befa8e00bc92 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -445,7 +445,9 @@ PREFIX-DIGITS is a list of the digits introduced so far."
 The optional FORCE option is for internal use only."
   (interactive
    (list
-    (unless (and (eq major-mode 'exwm-mode) exwm--fullscreen) ;it's invisible
+    (unless (and (eq major-mode 'exwm-mode)
+                 ;; The prompt is invisible in fullscreen mode.
+                 (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
       (let ((exwm-workspace--prompt-add-allowed t)
             (exwm-workspace--prompt-delete-allowed t))
         (exwm-workspace--prompt-for-workspace "Switch to [+/-]: ")))))
@@ -463,7 +465,8 @@ The optional FORCE option is for internal use only."
                          :value-mask xcb:ConfigWindow:StackMode
                          :stack-mode xcb:StackMode:Above))
       ;; Raise X windows with struts set if there's no fullscreen X window.
-      (unless (buffer-local-value 'exwm--fullscreen (window-buffer window))
+      (unless (with-current-buffer (window-buffer window)
+                (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
         (dolist (pair exwm-workspace--id-struts-alist)
           (xcb:+request exwm--connection
               (make-instance 'xcb:ConfigureWindow
@@ -537,7 +540,9 @@ deleted, moved, etc).")
 (defun exwm-workspace-swap (workspace1 workspace2)
   "Interchange position of WORKSPACE1 with that of WORKSPACE2."
   (interactive
-   (unless (and (eq major-mode 'exwm-mode) exwm--fullscreen) ;it's invisible
+   (unless (and (eq major-mode 'exwm-mode)
+                ;; The prompt is invisible in fullscreen mode.
+                (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
      (let (w1 w2)
        (let ((exwm-workspace--prompt-add-allowed t)
              (exwm-workspace--prompt-delete-allowed t))
@@ -572,7 +577,9 @@ deleted, moved, etc).")
 When called interactively, prompt for a workspace and move current one just
 before it."
   (interactive
-   (unless (and (eq major-mode 'exwm-mode) exwm--fullscreen) ;it's invisible
+   (unless (and (eq major-mode 'exwm-mode)
+                ;; The prompt is invisible in fullscreen mode.
+                (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
      (list exwm-workspace--current
            (exwm-workspace--position
             (exwm-workspace--prompt-for-workspace "Move workspace to: ")))))