about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-02-20T13·52+0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-20T13·52+0800
commite3d33a4aad6b5748e9352501b2c6cb058379025f (patch)
tree0e3d16cfbbf04e7990fd18a6372ef6a582a773fd /exwm-input.el
parent1c79e1c2384128915357ea629fc2a0503bd36733 (diff)
Prevent Emacs frames from restacking themselves
Putting Emacs frames (workspace frames, floating frames) into dedicated
containers greatly simplifies the stacking order management and totally
fixes relevant issues.

* exwm-floating.el (exwm-floating--set-floating): Create floating frame
container.  Remove redundant stacking order modification code.
(exwm-floating--unset-floating): Destroy the floating frame container.
No need to reparent the X window container.
(exwm-floating--do-moveresize): Resize the floating frame container.
* exwm-input.el (exwm-input--update-focus): No need to restack frames.
* exwm-layout.el (exwm-layout--show, exwm-layout--set-frame-fullscreen)
(exwm-layout-enlarge-window): Resize the floating frame container.
* exwm-manage.el (exwm-manage--on-ConfigureRequest): Re-enable stacking
order modification on ConfigureRequest.

* exwm-workspace.el (exwm-workspace--confirm-kill-emacs): Reparent out all
frames on exit.  No need to remove selected events or created resources.
(exwm-workspace--init): Create workspace frame containers.

* exwm-layout.el (exwm-layout-set-fullscreen):
* exwm-manage.el (exwm-manage--unmanage-window): Remove a redundant call to
`xcb:flush'.

* exwm-manage.el (exwm-manage--unmanage-window): Force unmap the X window.
Unmap the floating frame before reparent it.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el14
1 files changed, 3 insertions, 11 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 5e078030c2ef..0a50bef26203 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -113,8 +113,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
                 (exwm-workspace-switch exwm-workspace-current-index t))
             (exwm--log "Set focus on #x%x" exwm--id)
             (exwm-input--set-focus exwm--id)
-            ;; Adjust stacking orders
             (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
@@ -132,16 +132,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
                     (make-instance 'xcb:ConfigureWindow
                                    :window exwm--container
                                    :value-mask xcb:ConfigWindow:StackMode
-                                   :stack-mode xcb:StackMode:Above))))
-            ;; Make sure Emacs frames are at bottom.
-            (xcb:+request exwm--connection
-                (make-instance 'xcb:ConfigureWindow
-                               :window (frame-parameter
-                                        (or exwm--floating-frame exwm--frame)
-                                        'exwm-outer-id)
-                               :value-mask xcb:ConfigWindow:StackMode
-                               :stack-mode xcb:StackMode:BottomIf))
-            (xcb:flush exwm--connection))
+                                   :stack-mode xcb:StackMode:Above)))
+              (xcb:flush exwm--connection)))
         (when (eq (selected-window) exwm-input--focus-window)
           (exwm--log "Focus on %s" exwm-input--focus-window)
           (select-frame-set-input-focus (window-frame exwm-input--focus-window)