Free unused X resources

* exwm-cm.el (exwm-cm--paint-tree): Make sure the clip can be
destroyed even the X window is in full screen mode.
(exwm-cm--paint-transparent, exwm-cm--paint-background): Free pixmaps
after creating pictures.
This commit is contained in:
Chris Feng 2017-11-19 14:46:35 +08:00
parent 0106dd69c7
commit 55626530f4

View file

@ -661,14 +661,14 @@ painting a frame."
(setq queue (setq queue
(nconc (exwm-cm--paint-tree subtree region fullscreen clip) (nconc (exwm-cm--paint-tree subtree region fullscreen clip)
queue)) queue))
(when fullscreen
;; Fullscreen X windows are always opaque thus occludes
;; anything in this workspace.
(throw 'break 'fullscreen))
(when clip (when clip
(xcb:+request exwm-cm--conn (xcb:+request exwm-cm--conn
(make-instance 'xcb:xfixes:DestroyRegion (make-instance 'xcb:xfixes:DestroyRegion
:region clip)))) :region clip)))
(when fullscreen
;; Fullscreen X windows are always opaque thus occludes
;; anything in this workspace.
(throw 'break 'fullscreen)))
(if (not (eq root exwm--root)) (if (not (eq root exwm--root))
;; Avoid painting any siblings below the workspace frame ;; Avoid painting any siblings below the workspace frame
;; container. ;; container.
@ -862,6 +862,9 @@ Also update the attributes of XWIN and clip the region."
xcb:renderutil:PICT_STANDARD:A_8) xcb:renderutil:PICT_STANDARD:A_8)
:value-mask xcb:render:CP:Repeat :value-mask xcb:render:CP:Repeat
:repeat 1)) :repeat 1))
(xcb:+request exwm-cm--conn
(make-instance 'xcb:FreePixmap
:pixmap pixmap))
(xcb:+request exwm-cm--conn (xcb:+request exwm-cm--conn
(make-instance 'xcb:render:FillRectangles (make-instance 'xcb:render:FillRectangles
:op xcb:render:PictOp:Src :op xcb:render:PictOp:Src
@ -1033,6 +1036,9 @@ the whole screen."
:value-mask xcb:render:CP:Repeat :value-mask xcb:render:CP:Repeat
:repeat 1)) :repeat 1))
(unless exist (unless exist
(xcb:+request exwm-cm--conn
(make-instance 'xcb:FreePixmap
:pixmap pixmap))
(xcb:+request exwm-cm--conn (xcb:+request exwm-cm--conn
(make-instance 'xcb:render:FillRectangles (make-instance 'xcb:render:FillRectangles
:op xcb:render:PictOp:Src :op xcb:render:PictOp:Src