about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-11-19T06·46+0800
committerChris Feng <chris.w.feng@gmail.com>2017-11-19T06·46+0800
commit55626530f4a523cccd1d24c8819f7e80543e0276 (patch)
tree85d07602f96ca088632a7b21a00edee0ae196a4b
parent0106dd69c767c8f7fdecb5f6f804ecaa0094848b (diff)
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.
-rw-r--r--exwm-cm.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/exwm-cm.el b/exwm-cm.el
index 233d5e077390..095b59f7a149 100644
--- a/exwm-cm.el
+++ b/exwm-cm.el
@@ -661,14 +661,14 @@ painting a frame."
             (setq queue
                   (nconc (exwm-cm--paint-tree subtree region fullscreen clip)
                          queue))
-            (when fullscreen
-              ;; Fullscreen X windows are always opaque thus occludes
-              ;; anything in this workspace.
-              (throw 'break 'fullscreen))
             (when clip
               (xcb:+request exwm-cm--conn
                   (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))
               ;; Avoid painting any siblings below the workspace frame
               ;; container.
@@ -863,6 +863,9 @@ Also update the attributes of XWIN and clip the region."
                            :value-mask xcb:render:CP:Repeat
                            :repeat 1))
         (xcb:+request exwm-cm--conn
+            (make-instance 'xcb:FreePixmap
+                           :pixmap pixmap))
+        (xcb:+request exwm-cm--conn
             (make-instance 'xcb:render:FillRectangles
                            :op xcb:render:PictOp:Src
                            :dst alpha-picture
@@ -1034,6 +1037,9 @@ the whole screen."
                          :repeat 1))
       (unless exist
         (xcb:+request exwm-cm--conn
+            (make-instance 'xcb:FreePixmap
+                           :pixmap pixmap))
+        (xcb:+request exwm-cm--conn
             (make-instance 'xcb:render:FillRectangles
                            :op xcb:render:PictOp:Src
                            :dst exwm-cm--background