about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-16T06·34+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-16T06·34+0800
commit4ac71a7ddc78d1485a7fca7a8dbf4c4f6b4016f2 (patch)
treee3b9ff8f06ef87f3eb81314fd765df2c04c9619d /exwm.el
parent7f12d9fc7a88369a479ed2f0489ff3b10b347d13 (diff)
Add RandR support for docks and reuse workareas
* exwm-workspace (exwm-workspace--update-struts): Add RandR support for
docks.

* exwm-workspace (exwm-workspace--workareas): New variable for storing
workareas.
(exwm-workspace--update-workareas): Update workareas and set
_NET_WORKAREA (replaces `exwm-workspace--set-workareas').
(exwm-workspace--set-fullscreen): Reuse workareas for
resizing and drop optional arguments.
(exwm-workspace--resize-minibuffer-frame)
(exwm-workspace--on-ConfigureNotify): Reuse workareas for
resizing/reposition the (optional) dedicated minibuffer frame.

* exwm-layout.el (exwm-layout-set-fullscreen): Do not use
`exwm-workspace--set-fullscreen' here.

* exwm-manage.el (exwm-manage--unmanage-window):
* exwm-randr.el (exwm-randr--refresh):
* exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial):
Update workareas before resizing workspaces.

* exwm.el (exwm--update-struts-legacy, exwm--update-struts-partial):
Remove the corresponding record on receiving invalid struts.

* exwm-workspace.el (exwm-workspace--get-geometry): New utility
function for retrieving workspace geometry.
Diffstat (limited to 'exwm.el')
-rw-r--r--exwm.el32
1 files changed, 20 insertions, 12 deletions
diff --git a/exwm.el b/exwm.el
index 59f43136f786..814104a86dd2 100644
--- a/exwm.el
+++ b/exwm.el
@@ -237,15 +237,19 @@
                                      :window id)))
       (when reply
         (setq struts (slot-value reply 'value))
-        (if pair
-            (setcdr pair struts)
-          (push (cons id struts) exwm-workspace--id-struts-alist))
+        (if struts
+            (if pair
+                (setcdr pair struts)
+              (push (cons id struts) exwm-workspace--id-struts-alist))
+          (when pair
+            (setq exwm-workspace--id-struts-alist
+                  (assq-delete-all id exwm-workspace--id-struts-alist))))
         (exwm-workspace--update-struts))
+      ;; Update workareas and set _NET_WORKAREA.
+      (exwm-workspace--update-workareas)
       ;; Update workspaces.
       (dolist (f exwm-workspace--list)
-        (exwm-workspace--set-fullscreen f))
-      ;; Update _NET_WORKAREA.
-      (exwm-workspace--set-workareas))))
+        (exwm-workspace--set-fullscreen f)))))
 
 (defun exwm--update-struts-partial (id)
   "Update _NET_WM_STRUT_PARTIAL."
@@ -256,15 +260,19 @@
     (when reply
       (setq struts (slot-value reply 'value)
             pair (assq id exwm-workspace--id-struts-alist))
-      (if pair
-          (setcdr pair struts)
-        (push (cons id struts) exwm-workspace--id-struts-alist))
+      (if struts
+          (if pair
+              (setcdr pair struts)
+            (push (cons id struts) exwm-workspace--id-struts-alist))
+        (when pair
+          (setq exwm-workspace--id-struts-alist
+                (assq-delete-all id exwm-workspace--id-struts-alist))))
       (exwm-workspace--update-struts))
+    ;; Update workareas and set _NET_WORKAREA.
+    (exwm-workspace--update-workareas)
     ;; Update workspaces.
     (dolist (f exwm-workspace--list)
-      (exwm-workspace--set-fullscreen f))
-    ;; Update _NET_WORKAREA.
-    (exwm-workspace--set-workareas)))
+      (exwm-workspace--set-fullscreen f))))
 
 (defun exwm--update-struts (id)
   "Update _NET_WM_STRUT_PARTIAL or _NET_WM_STRUT."