about summary refs log tree commit diff
path: root/third_party/exwm/exwm-workspace.el
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-03-30T09·25+0200
committerVincent Ambo <mail@tazj.in>2022-03-30T09·25+0200
commit79d1345012b1542b44a682bb7b99e0615187e4b5 (patch)
tree81e7b80cb26743d0d0a4af8f7aa6a826a489ac79 /third_party/exwm/exwm-workspace.el
parent8e85079012dd9869753d0f60849f83b8f3cb6459 (diff)
parente43bd782580fc7f2aa7f5f92da1c5d7c992b6d1c (diff)
subtree(3p/exwm): Update to commit 'e43bd782' r/3921
Change-Id: I832c4d7f26e8fa4a2d7c3f26a81ba981ebbc1d8c
Diffstat (limited to 'third_party/exwm/exwm-workspace.el')
-rw-r--r--third_party/exwm/exwm-workspace.el26
1 files changed, 22 insertions, 4 deletions
diff --git a/third_party/exwm/exwm-workspace.el b/third_party/exwm/exwm-workspace.el
index c513347119a2..fc68e1b07053 100644
--- a/third_party/exwm/exwm-workspace.el
+++ b/third_party/exwm/exwm-workspace.el
@@ -1326,7 +1326,8 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
   (let ((outer-id (string-to-number (frame-parameter frame
                                                      'outer-window-id)))
         (window-id (string-to-number (frame-parameter frame 'window-id)))
-        (container (xcb:generate-id exwm--connection)))
+        (container (xcb:generate-id exwm--connection))
+        frame-colormap frame-visual frame-depth)
     ;; Save window IDs
     (set-frame-parameter frame 'exwm-outer-id outer-id)
     (set-frame-parameter frame 'exwm-id window-id)
@@ -1340,9 +1341,17 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
       (dolist (param '(exwm-randr-monitor
                        exwm-geometry))
         (set-frame-parameter frame param (frame-parameter w param))))
+    ;; Support transparency on the container X window when the Emacs frame
+    ;; does.  Note that in addition to setting the visual, colormap and depth
+    ;; we must also reset the `:border-pixmap', as its default value is
+    ;; relative to the parent window, which might have a different depth.
+    (let* ((vdc (exwm--get-visual-depth-colormap exwm--connection outer-id)))
+      (setq frame-visual (car vdc))
+      (setq frame-depth (cadr vdc))
+      (setq frame-colormap (caddr vdc)))
     (xcb:+request exwm--connection
         (make-instance 'xcb:CreateWindow
-                       :depth 0
+                       :depth frame-depth
                        :wid container
                        :parent exwm--root
                        :x -1
@@ -1351,10 +1360,14 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
                        :height 1
                        :border-width 0
                        :class xcb:WindowClass:InputOutput
-                       :visual 0
+                       :visual frame-visual
                        :value-mask (logior xcb:CW:BackPixmap
+                                           xcb:CW:BorderPixel
+                                           xcb:CW:Colormap
                                            xcb:CW:OverrideRedirect)
-                       :background-pixmap xcb:BackPixmap:ParentRelative
+                       :background-pixmap xcb:BackPixmap:None
+                       :border-pixel 0
+                       :colormap frame-colormap
                        :override-redirect 1))
     (xcb:+request exwm--connection
         (make-instance 'xcb:ConfigureWindow
@@ -1371,6 +1384,11 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
         (make-instance 'xcb:ReparentWindow
                        :window outer-id :parent container :x 0 :y 0))
     (xcb:+request exwm--connection
+        (make-instance 'xcb:icccm:set-WM_STATE
+                       :window outer-id
+                       :state xcb:icccm:WM_STATE:NormalState
+                       :icon xcb:Window:None))
+    (xcb:+request exwm--connection
         (make-instance 'xcb:MapWindow :window container)))
   (xcb:flush exwm--connection)
   ;; Delay making the workspace fullscreen until Emacs becomes idle