Always put the desktop at bottom

* exwm-manage.el (exwm-manage--desktop): New variable for recording the
desktop X window.
(exwm-manage--manage-window): Check for desktop.
* exwm-workspace.el (exwm-workspace--resize-minibuffer-frame)
(exwm-workspace--hide-minibuffer): Put the minibuffer container above
desktop if any.
This commit is contained in:
Chris Feng 2016-08-12 19:22:18 +08:00
parent 6bd85db300
commit 8a438c2c17
2 changed files with 29 additions and 3 deletions

View file

@ -37,6 +37,8 @@ You can still make the X windows floating afterwards.")
"Normal hook run after a window is just managed, in the context of the "Normal hook run after a window is just managed, in the context of the
corresponding buffer.") corresponding buffer.")
(defvar exwm-manage--desktop nil "The desktop X window.")
(defun exwm-manage--update-geometry (id &optional force) (defun exwm-manage--update-geometry (id &optional force)
"Update window geometry." "Update window geometry."
(with-current-buffer (exwm--id->buffer id) (with-current-buffer (exwm--id->buffer id)
@ -198,6 +200,16 @@ corresponding buffer.")
:y (/ (- (exwm-workspace--current-height) :y (/ (- (exwm-workspace--current-height)
height) height)
2))))) 2)))))
;; Check for desktop.
(when (memq xcb:Atom:_NET_WM_WINDOW_TYPE_DESKTOP exwm-window-type)
;; There should be only one desktop X window.
(setq exwm-manage--desktop id)
;; Put it at bottom.
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window id
:value-mask xcb:ConfigWindow:StackMode
:stack-mode xcb:StackMode:Below)))
(xcb:flush exwm--connection) (xcb:flush exwm--connection)
(setq exwm--id-buffer-alist (assq-delete-all id exwm--id-buffer-alist)) (setq exwm--id-buffer-alist (assq-delete-all id exwm--id-buffer-alist))
(let ((kill-buffer-query-functions nil)) (let ((kill-buffer-query-functions nil))

View file

@ -29,6 +29,8 @@
(require 'exwm-core) (require 'exwm-core)
(defvar exwm-manage--desktop)
(defvar exwm-workspace-number 1 "Initial number of workspaces.") (defvar exwm-workspace-number 1 "Initial number of workspaces.")
(defvar exwm-workspace--list nil "List of all workspaces (Emacs frames).") (defvar exwm-workspace--list nil "List of all workspaces (Emacs frames).")
(defvar exwm-workspace--current nil "Current active workspace.") (defvar exwm-workspace--current nil "Current active workspace.")
@ -369,11 +371,17 @@ If the minibuffer is detached, this value is 0.")
:value-mask (logior xcb:ConfigWindow:X :value-mask (logior xcb:ConfigWindow:X
xcb:ConfigWindow:Y xcb:ConfigWindow:Y
xcb:ConfigWindow:Width xcb:ConfigWindow:Width
(if exwm-manage--desktop
xcb:ConfigWindow:Sibling
0)
xcb:ConfigWindow:StackMode) xcb:ConfigWindow:StackMode)
:x (aref workarea 0) :x (aref workarea 0)
:y y :y y
:width width :width width
:stack-mode xcb:StackMode:Below)) :sibling exwm-manage--desktop
:stack-mode (if exwm-manage--desktop
xcb:StackMode:Above
xcb:StackMode:Below)))
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow (make-instance 'xcb:ConfigureWindow
:window (frame-parameter exwm-workspace--minibuffer :window (frame-parameter exwm-workspace--minibuffer
@ -987,8 +995,14 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
(make-instance 'xcb:ConfigureWindow (make-instance 'xcb:ConfigureWindow
:window (frame-parameter exwm-workspace--minibuffer :window (frame-parameter exwm-workspace--minibuffer
'exwm-container) 'exwm-container)
:value-mask xcb:ConfigWindow:StackMode :value-mask (logior (if exwm-manage--desktop
:stack-mode xcb:StackMode:Below)) xcb:ConfigWindow:Sibling
0)
xcb:ConfigWindow:StackMode)
:sibling exwm-manage--desktop
:stack-mode (if exwm-manage--desktop
xcb:StackMode:Above
xcb:StackMode:Below)))
(xcb:flush exwm--connection)) (xcb:flush exwm--connection))
(defun exwm-workspace--on-minibuffer-setup () (defun exwm-workspace--on-minibuffer-setup ()