about summary refs log tree commit diff
path: root/exwm-randr.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-19T02·34+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-19T02·34+0800
commit2ebeec12570636e673d08c8b4d47e12ce0da048b (patch)
tree9ad209d2dc8e0f8f42c25bf1e213e5a4028f167e /exwm-randr.el
parent4c9afc25b322d30b21eeea2cf3af7def0fc1dbb4 (diff)
Adapt dynamic workspace for RandR module
* exwm-workspace.el (exwm-workspace-list-change-hook):
New hook run when the workspace list is modified.
* exwm-randr.el (exwm-randr--init, exwm-randr--exit):
* exwm-workspace.el (exwm-workspace-swap, exwm-workspace-move)
(exwm-workspace--add-frame-as-workspace)
(exwm-workspace--remove-frame-as-workspace):
Use it.
Diffstat (limited to 'exwm-randr.el')
-rw-r--r--exwm-randr.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/exwm-randr.el b/exwm-randr.el
index ac3341db3c49..709469a44d0a 100644
--- a/exwm-randr.el
+++ b/exwm-randr.el
@@ -154,10 +154,12 @@
                            ;;            xcb:randr:NotifyMask:OutputProperty
                            ;;            xcb:randr:NotifyMask:CrtcChange))
                            ))
-        (xcb:flush exwm--connection)))))
+        (xcb:flush exwm--connection)
+        (add-hook 'exwm-workspace-list-change-hook #'exwm-randr--refresh)))))
 
 (defun exwm-randr--exit ()
-  "Exit the RandR module.")
+  "Exit the RandR module."
+  (remove-hook 'exwm-workspace-list-change-hook #'exwm-randr--refresh))
 
 (defun exwm-randr-enable ()
   "Enable RandR support for EXWM."