diff --git a/exwm-workspace.el b/exwm-workspace.el index ed115bf..3dde7d9 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -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 () diff --git a/exwm.el b/exwm.el index a4273c0..21efd8f 100644 --- a/exwm.el +++ b/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