Add support for attachable/detachable minibuffer

* exwm-workspace.el (exwm-workspace--update-minibuffer-height): Renamed
from `exwm-workspace--update-minibuffer' to better reflect its usage.

* exwm-input.el (exwm-input--update-focus): Directly put the floating
X window at top since the minibuffer is no longer a sibling.
* exwm-workspace.el (exwm-workspace--resize-minibuffer-frame): Calculate
position in absolute coordinate; put minibuffer at bottom by default;
resize the minibuffer frame with ConfigureWindow rather than
`set-frame-width'.
(exwm-workspace-switch): No need to reparent minibuffer any more.
(exwm-workspace--on-ConfigureNotify): Calculate position in absolute
coordinate.
(exwm-workspace--show-minibuffer, exwm-workspace--hide-minibuffer):
Show/Hide the minibuffer by adjusting the stacking order rather than
mapping/unmapping.
(exwm-workspace--init): Map the minibuffer frame container on creation.

* exwm-workspace.el (exwm-workspace--minibuffer-attached-p):
New function telling whether the minibuffer is attached.
(exwm-workspace--attached-minibuffer-height): New variable storing the
height of the attached minibuffer.
(exwm-workspace-attach-minibuffer, exwm-workspace-detach-minibuffer):
New functions for attaching/detaching the minibuffer.

* exwm-workspace.el (exwm-workspace--show-minibuffer): Remove the
workaround for minibuffer cursor (seems fixed).
This commit is contained in:
Chris Feng 2016-07-19 19:23:37 +08:00
parent 624c72945a
commit 3909f65bae
2 changed files with 113 additions and 59 deletions

View file

@ -125,24 +125,11 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
(exwm-input--set-focus exwm--id)
(when exwm--floating-frame
;; Adjust stacking orders of the floating container.
(if (exwm-workspace--minibuffer-own-frame-p)
;; Put this floating X window just below the minibuffer.
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window exwm--container
:value-mask
(logior xcb:ConfigWindow:Sibling
xcb:ConfigWindow:StackMode)
:sibling (frame-parameter
exwm-workspace--minibuffer
'exwm-container)
:stack-mode xcb:StackMode:Below))
;; Put this floating X window at top.
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window exwm--container
:value-mask xcb:ConfigWindow:StackMode
:stack-mode xcb:StackMode:Above)))
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window exwm--container
:value-mask xcb:ConfigWindow:StackMode
:stack-mode xcb:StackMode:Above))
;; This floating X window might be hide by `exwm-floating-hide'.
(when (exwm-layout--iconic-state-p)
(exwm-layout--set-state exwm--id