about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-03-07T10·16+0800
committerChris Feng <chris.w.feng@gmail.com>2016-03-07T10·16+0800
commita50e6bd384d2157cb5070f138eb64d23496cf7ac (patch)
treec52798c88a50eea9c737cf510922ceede6c436e6 /exwm-layout.el
parentf0a5425f4c176c487a5c3e94319f0c2b3d3cc22a (diff)
Restack fullscreen X windows
* exwm-layout.el (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen): Raise and lower fullscreen X windows
respectively.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el29
1 files changed, 22 insertions, 7 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 76721a01a1c5..309bfb6fb672 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -165,6 +165,12 @@
     (exwm-layout--resize-container exwm--id exwm--container 0 0
                                    (exwm-workspace--current-width)
                                    (exwm-workspace--current-height))
+    ;; Raise the X window.
+    (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:ewmh:set-_NET_WM_STATE
                        :window exwm--id
@@ -180,16 +186,25 @@
   (with-current-buffer (if id (exwm--id->buffer id) (window-buffer))
     (unless exwm--fullscreen
       (user-error "Not in full-screen mode."))
-    ;; Restore the floating frame if the client is floating
-    (when exwm--floating-frame
+    (if exwm--floating-frame
+        ;; Restore the floating frame.
+        (xcb:+request exwm--connection
+            (make-instance 'xcb:ConfigureWindow
+                           :window exwm--container
+                           :value-mask (eval-when-compile
+                                         (logior xcb:ConfigWindow:X
+                                                 xcb:ConfigWindow:Y))
+                           :x (elt exwm--floating-frame-position 0)
+                           :y (elt exwm--floating-frame-position 1)))
+      ;; Put the X window just above the Emacs frame.
       (xcb:+request exwm--connection
           (make-instance 'xcb:ConfigureWindow
                          :window exwm--container
-                         :value-mask (eval-when-compile
-                                       (logior xcb:ConfigWindow:X
-                                               xcb:ConfigWindow:Y))
-                         :x (elt exwm--floating-frame-position 0)
-                         :y (elt exwm--floating-frame-position 1))))
+                         :value-mask (logior xcb:ConfigWindow:Sibling
+                                             xcb:ConfigWindow:StackMode)
+                         :sibling (frame-parameter exwm-workspace--current
+                                                   'exwm-container)
+                         :stack-mode xcb:StackMode:Above)))
     (exwm-layout--show exwm--id)
     (xcb:+request exwm--connection
         (make-instance 'xcb:ewmh:set-_NET_WM_STATE :window exwm--id :data []))