Support displaying floating X windows on all workspaces

; Setting _NET_WM_DESKTOP to 0xffffffff makes an X windows appearing
; on all desktops (EWMH).  It's tricky to do it for tiling X windows
; so it's not implemented.

* exwm-core.el (exwm--desktop): New buffer-local variable recording
the value of _NET_WM_DESKTOP.
* exwm-layout.el (exwm-layout--hide): Do not hide X windows with this
property set to 0xffffffff.

* exwm.el (exwm--update-desktop): New function for fetching the value
of _NET_WM_DESKTOP and setting `exwm--desktop'.
* exwm-manage.el (exwm-manage--manage-window): Use it.

* exwm-workspace.el (exwm-workspace--set-desktop): Also update
`exwm--desktop'.
This commit is contained in:
Chris Feng 2018-02-19 22:34:03 +08:00
parent d22e6740d7
commit b8ce20b4f3
5 changed files with 38 additions and 18 deletions

View file

@ -73,6 +73,7 @@ You can still make the X windows floating afterwards."
(declare-function exwm--update-struts "exwm.el" (id))
(declare-function exwm--update-title "exwm.el" (id))
(declare-function exwm--update-transient-for "exwm.el" (id &optional force))
(declare-function exwm--update-desktop "exwm.el" (id &optional force))
(declare-function exwm--update-window-type "exwm.el" (id &optional force))
(declare-function exwm-floating--set-floating "exwm-floating.el" (id))
(declare-function exwm-floating--unset-floating "exwm-floating.el" (id))
@ -252,19 +253,7 @@ You can still make the X windows floating afterwards."
(exwm-floating--unset-floating id))
(exwm-input-grab-keyboard id)
(setq exwm-workspace--switch-history-outdated t)
;; Set _NET_WM_DESKTOP or move window.
(let ((reply (xcb:+request-unchecked+reply exwm--connection
(make-instance 'xcb:ewmh:get-_NET_WM_DESKTOP
:window id)))
desktop)
(when reply
(setq desktop (slot-value reply 'value)))
(if (and desktop
(/= desktop exwm-workspace-current-index)
;; Check the range.
(< desktop (exwm-workspace--count)))
(exwm-workspace-move-window desktop id)
(exwm-workspace--set-desktop id)))
(exwm--update-desktop id)
(exwm-manage--update-ewmh-state id)
(with-current-buffer (exwm--id->buffer id)
(when (memq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)