about summary refs log tree commit diff
path: root/exwm-manage.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-09-23T10·41+0800
committerChris Feng <chris.w.feng@gmail.com>2016-09-23T10·41+0800
commit6be75083c2adeb54882061e82597fab4cdf2a4f4 (patch)
tree74293125fc05cdf53ac7202f490f01d003ae760b /exwm-manage.el
parent2597f74c7fb9ad290a45c89d0025bebcf739a976 (diff)
Use X window borders
; This commit replaces the internal borders of Emacs frames with X
; window borders.  This should make the flickering issue of floating X
; windows less serious.

* exwm-floating.el (exwm-floating--border-pixel)
(exwm-floating--border-colormap): New variables for storing border pixel
and its colormap.
(exwm-floating--set-floating): Do not set the internal border (and
background color) of floating frames; do not take
`exwm-floating-border-width' into account when calculating geometries;
set the border of floating X window containers.
(exwm-floating--unset-floating): No need to restore the position of X
windows any more; hide the border of floating X window containers.
(exwm-floating--init): Initialize the border pixel.
* exwm-layout.el (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen): Show/Hide container border respectively.
* exwm-manage.el (exwm-manage--manage-window): Set the border pixel and
colormap of X window containers.
* exwm-workspace.el (exwm-workspace-move-window): Do not set the
internal border and background color of floating frames.
* exwm.el (exwm--on-ClientMessage): Simplify the code for calculating
_NET_REQUEST_FRAME_EXTENTS.
Diffstat (limited to 'exwm-manage.el')
-rw-r--r--exwm-manage.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/exwm-manage.el b/exwm-manage.el
index 0f1a80b72946..f1deda0759f1 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -92,6 +92,8 @@ corresponding buffer.")
                      :window exwm--root
                      :data (vconcat (mapcar #'car exwm--id-buffer-alist)))))
 
+(defvar exwm-floating--border-colormap)
+(defvar exwm-floating--border-pixel)
 (defvar exwm-workspace--current)
 (defvar exwm-workspace--switch-history-outdated)
 (defvar exwm-workspace-current-index)
@@ -243,11 +245,16 @@ corresponding buffer.")
                          :class xcb:WindowClass:InputOutput
                          :visual 0
                          :value-mask (logior xcb:CW:BackPixmap
+                                             (if exwm-floating--border-pixel
+                                                 xcb:CW:BorderPixel 0)
                                              xcb:CW:OverrideRedirect
-                                             xcb:CW:EventMask)
+                                             xcb:CW:EventMask
+                                             xcb:CW:Colormap)
                          :background-pixmap xcb:BackPixmap:ParentRelative
+                         :border-pixel exwm-floating--border-pixel
                          :override-redirect 1
-                         :event-mask xcb:EventMask:SubstructureRedirect))
+                         :event-mask xcb:EventMask:SubstructureRedirect
+                         :colormap exwm-floating--border-colormap))
       (exwm--debug
        (xcb:+request exwm--connection
            (make-instance 'xcb:ewmh:set-_NET_WM_NAME