Update EWMH properties when workspaces change

This commit is contained in:
Urbano Ustero 2015-08-26 23:49:34 +02:00
parent ce2ccc3f62
commit 0995e90ed0
2 changed files with 20 additions and 17 deletions

View file

@ -292,6 +292,26 @@ The optional FORCE option is for internal use only."
(lambda (i)
(frame-parameter i 'exwm-window-id))
exwm-workspace--list))))
;; Set _NET_NUMBER_OF_DESKTOPS
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_NUMBER_OF_DESKTOPS
:window exwm--root
:data num-workspaces))
;; Set _NET_DESKTOP_VIEWPORT
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_VIEWPORT
:window exwm--root
:data (make-vector (* 2 num-workspaces) 0)))
;; Set _NET_WORKAREA (with minibuffer and bottom mode-line excluded)
(let* ((workareas
(vector 0 0 (x-display-pixel-width) (x-display-pixel-height)))
(workareas (mapconcat (lambda (i) workareas)
(make-list num-workspaces 0) [])))
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_WORKAREA
:window exwm--root
:data workareas)))
(xcb:flush exwm--connection)))
(defun exwm-workspace--init ()

17
exwm.el
View file

@ -568,23 +568,6 @@
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
:window i :data "EXWM"))))
;; Set _NET_NUMBER_OF_DESKTOPS
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_NUMBER_OF_DESKTOPS
:window exwm--root :data exwm-workspace-max-count))
;; Set _NET_DESKTOP_VIEWPORT
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_VIEWPORT
:window exwm--root
:data (make-vector (* 2 exwm-workspace-max-count) 0)))
;; Set _NET_WORKAREA (with minibuffer and bottom mode-line excluded)
(let* ((workareas
(vector 0 0 (x-display-pixel-width) (x-display-pixel-height)))
(workareas (mapconcat (lambda (i) workareas)
(make-list exwm-workspace-max-count 0) [])))
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_WORKAREA
:window exwm--root :data workareas)))
(xcb:flush exwm--connection))
(defvar exwm-init-hook nil