mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-27 21:18:00 +01:00
Update EWMH properties when workspaces change
This commit is contained in:
parent
ce2ccc3f62
commit
0995e90ed0
2 changed files with 20 additions and 17 deletions
|
@ -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
17
exwm.el
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue