Consistently name helper windows
* exwm.el (exwm--init-icccm-ewmh): Avoid naming the root window. (exwm--wmsn-acquire): Use the symbol name in the window name. * exwm-systemtray.el (exwm-systemtray--embedder-window): Rename `exwm-systemtray--embedder' consistency. (exwm-systemtray--init): Use symbol names in the window name.
This commit is contained in:
parent
4d43e3119a
commit
29f2289a75
2 changed files with 27 additions and 22 deletions
|
@ -70,7 +70,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defvar exwm-systemtray--connection nil "The X connection.")
|
(defvar exwm-systemtray--connection nil "The X connection.")
|
||||||
|
|
||||||
(defvar exwm-systemtray--embedder nil "The embedder window.")
|
(defvar exwm-systemtray--embedder-window nil "The embedder window.")
|
||||||
|
|
||||||
(defvar exwm-systemtray--list nil "The icon list.")
|
(defvar exwm-systemtray--list nil "The icon list.")
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ReparentWindow
|
(make-instance 'xcb:ReparentWindow
|
||||||
:window icon
|
:window icon
|
||||||
:parent exwm-systemtray--embedder
|
:parent exwm-systemtray--embedder-window
|
||||||
:x 0
|
:x 0
|
||||||
;; Vertically centered.
|
;; Vertically centered.
|
||||||
:y (/ (- exwm-systemtray-height height*) 2)))
|
:y (/ (- exwm-systemtray-height height*) 2)))
|
||||||
|
@ -162,7 +162,8 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(make-instance 'xcb:xembed:EMBEDDED-NOTIFY
|
(make-instance 'xcb:xembed:EMBEDDED-NOTIFY
|
||||||
:window icon
|
:window icon
|
||||||
:time xcb:Time:CurrentTime
|
:time xcb:Time:CurrentTime
|
||||||
:embedder exwm-systemtray--embedder
|
:embedder
|
||||||
|
exwm-systemtray--embedder-window
|
||||||
:version 0)
|
:version 0)
|
||||||
exwm-systemtray--connection)))
|
exwm-systemtray--connection)))
|
||||||
(push `(,icon . ,(make-instance 'exwm-systemtray--icon
|
(push `(,icon . ,(make-instance 'exwm-systemtray--icon
|
||||||
|
@ -190,7 +191,8 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
"Refresh the system tray."
|
"Refresh the system tray."
|
||||||
;; Make sure to redraw the embedder.
|
;; Make sure to redraw the embedder.
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:UnmapWindow :window exwm-systemtray--embedder))
|
(make-instance 'xcb:UnmapWindow
|
||||||
|
:window exwm-systemtray--embedder-window))
|
||||||
(let ((x exwm-systemtray-icon-gap)
|
(let ((x exwm-systemtray-icon-gap)
|
||||||
map)
|
map)
|
||||||
(dolist (pair exwm-systemtray--list)
|
(dolist (pair exwm-systemtray--list)
|
||||||
|
@ -207,14 +209,15 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
exwm-workspace-current-index)))
|
exwm-workspace-current-index)))
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ConfigureWindow
|
(make-instance 'xcb:ConfigureWindow
|
||||||
:window exwm-systemtray--embedder
|
:window exwm-systemtray--embedder-window
|
||||||
:value-mask (logior xcb:ConfigWindow:X
|
:value-mask (logior xcb:ConfigWindow:X
|
||||||
xcb:ConfigWindow:Width)
|
xcb:ConfigWindow:Width)
|
||||||
:x (- (aref workarea 2) x)
|
:x (- (aref workarea 2) x)
|
||||||
:width x)))
|
:width x)))
|
||||||
(when map
|
(when map
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:MapWindow :window exwm-systemtray--embedder))))
|
(make-instance 'xcb:MapWindow
|
||||||
|
:window exwm-systemtray--embedder-window))))
|
||||||
(xcb:flush exwm-systemtray--connection))
|
(xcb:flush exwm-systemtray--connection))
|
||||||
|
|
||||||
(defun exwm-systemtray--on-DestroyNotify (data _synthetic)
|
(defun exwm-systemtray--on-DestroyNotify (data _synthetic)
|
||||||
|
@ -230,7 +233,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(let ((obj (make-instance 'xcb:ReparentNotify)))
|
(let ((obj (make-instance 'xcb:ReparentNotify)))
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
(with-slots (window parent) obj
|
(with-slots (window parent) obj
|
||||||
(when (and (/= parent exwm-systemtray--embedder)
|
(when (and (/= parent exwm-systemtray--embedder-window)
|
||||||
(assoc window exwm-systemtray--list))
|
(assoc window exwm-systemtray--list))
|
||||||
(exwm-systemtray--unembed window)))))
|
(exwm-systemtray--unembed window)))))
|
||||||
|
|
||||||
|
@ -325,7 +328,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(unless (exwm-workspace--minibuffer-own-frame-p)
|
(unless (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ReparentWindow
|
(make-instance 'xcb:ReparentWindow
|
||||||
:window exwm-systemtray--embedder
|
:window exwm-systemtray--embedder-window
|
||||||
:parent (string-to-number
|
:parent (string-to-number
|
||||||
(frame-parameter exwm-workspace--current
|
(frame-parameter exwm-workspace--current
|
||||||
'window-id))
|
'window-id))
|
||||||
|
@ -339,7 +342,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(unless (exwm-workspace--minibuffer-own-frame-p)
|
(unless (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ConfigureWindow
|
(make-instance 'xcb:ConfigureWindow
|
||||||
:window exwm-systemtray--embedder
|
:window exwm-systemtray--embedder-window
|
||||||
:value-mask xcb:ConfigWindow:Y
|
:value-mask xcb:ConfigWindow:Y
|
||||||
:y (- (frame-pixel-height exwm-workspace--current)
|
:y (- (frame-pixel-height exwm-workspace--current)
|
||||||
exwm-systemtray-height))))
|
exwm-systemtray-height))))
|
||||||
|
@ -353,7 +356,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(cl-assert (not exwm-systemtray--connection))
|
(cl-assert (not exwm-systemtray--connection))
|
||||||
(cl-assert (not exwm-systemtray--list))
|
(cl-assert (not exwm-systemtray--list))
|
||||||
(cl-assert (not exwm-systemtray--selection-owner-window))
|
(cl-assert (not exwm-systemtray--selection-owner-window))
|
||||||
(cl-assert (not exwm-systemtray--embedder))
|
(cl-assert (not exwm-systemtray--embedder-window))
|
||||||
(unless exwm-systemtray-height
|
(unless exwm-systemtray-height
|
||||||
(setq exwm-systemtray-height (max exwm-systemtray--icon-min-size
|
(setq exwm-systemtray-height (max exwm-systemtray--icon-min-size
|
||||||
(line-pixel-height))))
|
(line-pixel-height))))
|
||||||
|
@ -414,7 +417,8 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
;; Set _NET_WM_NAME.
|
;; Set _NET_WM_NAME.
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
||||||
:window id :data "EXWM system tray selection owner"))
|
:window id
|
||||||
|
:data "EXWM: exwm-systemtray--selection-owner-window"))
|
||||||
;; Set the _NET_SYSTEM_TRAY_ORIENTATION property.
|
;; Set the _NET_SYSTEM_TRAY_ORIENTATION property.
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:xembed:set-_NET_SYSTEM_TRAY_ORIENTATION
|
(make-instance 'xcb:xembed:set-_NET_SYSTEM_TRAY_ORIENTATION
|
||||||
|
@ -423,7 +427,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
;; Create the embedder.
|
;; Create the embedder.
|
||||||
(let ((id (xcb:generate-id exwm-systemtray--connection))
|
(let ((id (xcb:generate-id exwm-systemtray--connection))
|
||||||
frame parent depth y)
|
frame parent depth y)
|
||||||
(setq exwm-systemtray--embedder id)
|
(setq exwm-systemtray--embedder-window id)
|
||||||
(if (exwm-workspace--minibuffer-own-frame-p)
|
(if (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(setq frame exwm-workspace--minibuffer
|
(setq frame exwm-workspace--minibuffer
|
||||||
y (if (>= (line-pixel-height) exwm-systemtray-height)
|
y (if (>= (line-pixel-height) exwm-systemtray-height)
|
||||||
|
@ -460,7 +464,8 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
;; Set _NET_WM_NAME.
|
;; Set _NET_WM_NAME.
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
||||||
:window id :data "EXWM system tray embedder")))
|
:window id
|
||||||
|
:data "EXWM: exwm-systemtray--embedder-window")))
|
||||||
(xcb:flush exwm-systemtray--connection)
|
(xcb:flush exwm-systemtray--connection)
|
||||||
;; Attach event listeners.
|
;; Attach event listeners.
|
||||||
(xcb:+event exwm-systemtray--connection 'xcb:DestroyNotify
|
(xcb:+event exwm-systemtray--connection 'xcb:DestroyNotify
|
||||||
|
@ -494,10 +499,10 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
;; parent of the embedder).
|
;; parent of the embedder).
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:UnmapWindow
|
(make-instance 'xcb:UnmapWindow
|
||||||
:window exwm-systemtray--embedder))
|
:window exwm-systemtray--embedder-window))
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ReparentWindow
|
(make-instance 'xcb:ReparentWindow
|
||||||
:window exwm-systemtray--embedder
|
:window exwm-systemtray--embedder-window
|
||||||
:parent exwm--root
|
:parent exwm--root
|
||||||
:x 0
|
:x 0
|
||||||
:y 0))
|
:y 0))
|
||||||
|
@ -505,7 +510,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(setq exwm-systemtray--connection nil
|
(setq exwm-systemtray--connection nil
|
||||||
exwm-systemtray--list nil
|
exwm-systemtray--list nil
|
||||||
exwm-systemtray--selection-owner-window nil
|
exwm-systemtray--selection-owner-window nil
|
||||||
exwm-systemtray--embedder nil)
|
exwm-systemtray--embedder-window nil)
|
||||||
(remove-hook 'exwm-workspace-switch-hook
|
(remove-hook 'exwm-workspace-switch-hook
|
||||||
#'exwm-systemtray--on-workspace-switch)
|
#'exwm-systemtray--on-workspace-switch)
|
||||||
(remove-hook 'exwm-workspace--update-workareas-hook
|
(remove-hook 'exwm-workspace--update-workareas-hook
|
||||||
|
|
12
exwm.el
12
exwm.el
|
@ -665,15 +665,15 @@
|
||||||
:visual 0
|
:visual 0
|
||||||
:value-mask xcb:CW:OverrideRedirect
|
:value-mask xcb:CW:OverrideRedirect
|
||||||
:override-redirect 1))
|
:override-redirect 1))
|
||||||
|
;; Set _NET_WM_NAME
|
||||||
|
(xcb:+request exwm--connection
|
||||||
|
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
||||||
|
:window new-id :data "EXWM: exwm--guide-window"))
|
||||||
(dolist (i (list exwm--root new-id))
|
(dolist (i (list exwm--root new-id))
|
||||||
;; Set _NET_SUPPORTING_WM_CHECK
|
;; Set _NET_SUPPORTING_WM_CHECK
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_SUPPORTING_WM_CHECK
|
(make-instance 'xcb:ewmh:set-_NET_SUPPORTING_WM_CHECK
|
||||||
:window i :data new-id))
|
:window i :data new-id))))
|
||||||
;; Set _NET_WM_NAME
|
|
||||||
(xcb:+request exwm--connection
|
|
||||||
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
|
||||||
:window i :data "EXWM"))))
|
|
||||||
;; Set _NET_DESKTOP_VIEWPORT (we don't support large desktop).
|
;; Set _NET_DESKTOP_VIEWPORT (we don't support large desktop).
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_VIEWPORT
|
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_VIEWPORT
|
||||||
|
@ -712,7 +712,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
:override-redirect 0))
|
:override-redirect 0))
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
(make-instance 'xcb:ewmh:set-_NET_WM_NAME
|
||||||
:window new-owner :data "EXWM selection owner"))
|
:window new-owner :data "EXWM: exwm--wmsn-window"))
|
||||||
(xcb:+request-checked+request-check exwm--connection
|
(xcb:+request-checked+request-check exwm--connection
|
||||||
(make-instance 'xcb:SetSelectionOwner
|
(make-instance 'xcb:SetSelectionOwner
|
||||||
:selection xcb:Atom:WM_S0
|
:selection xcb:Atom:WM_S0
|
||||||
|
|
Loading…
Reference in a new issue