From 4ac71a7ddc78d1485a7fca7a8dbf4c4f6b4016f2 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sat, 16 Jul 2016 14:34:57 +0800 Subject: 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. --- exwm.el | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'exwm.el') 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." -- cgit 1.4.1