Prevent/Reduce flickering issues with floating X windows

* exwm-floating.el (exwm-floating--set-floating)
(exwm-floating--unset-floating): Prevent flickering when creating/removing
a floating X window.
* exwm-layout.el (exwm-layout--show): Show X windows after resizing to
prevent flickering.
* exwm-manage.el (exwm-manage--unmanage-window): Reduce flickering by
hiding the container.
(exwm-manage--kill-buffer-query-function): Prevent flickering by hiding the
container (except that the X window destroys itself after receiving the
WM_DELETE_WINDOW client message).
This commit is contained in:
Chris Feng 2016-02-20 14:52:53 +08:00
parent 33254c37df
commit 1c79e1c238
3 changed files with 78 additions and 29 deletions

View file

@ -53,14 +53,6 @@
(defun exwm-layout--show (id &optional window)
"Show window ID exactly fit in the Emacs window WINDOW."
(exwm--log "Show #x%x in %s" id window)
(xcb:+request exwm--connection (make-instance 'xcb:MapWindow :window id))
(with-current-buffer (exwm--id->buffer id)
(xcb:+request exwm--connection
(make-instance 'xcb:MapWindow :window exwm--container)))
(xcb:+request exwm--connection
(make-instance 'xcb:icccm:set-WM_STATE
:window id :state xcb:icccm:WM_STATE:NormalState
:icon xcb:Window:None))
(let* ((edges (window-inside-absolute-pixel-edges window))
(width (- (elt edges 2) (elt edges 0)))
(height (- (elt edges 3) (elt edges 1))))
@ -93,7 +85,16 @@
(elt relative-edges 0)
(elt relative-edges 1)
width height
(active-minibuffer-window)))))
(active-minibuffer-window))))
;; Make the resizing take effect.
(xcb:flush exwm--connection)
(xcb:+request exwm--connection (make-instance 'xcb:MapWindow :window id))
(xcb:+request exwm--connection
(make-instance 'xcb:MapWindow :window exwm--container))
(xcb:+request exwm--connection
(make-instance 'xcb:icccm:set-WM_STATE
:window id :state xcb:icccm:WM_STATE:NormalState
:icon xcb:Window:None)))
(xcb:+request exwm--connection
(make-instance 'xcb:SendEvent
:propagate 0 :destination id