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-02-18T11·56+0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-18T11·56+0800
commit3f7722079cebd0d998239ce40457899135250a15 (patch)
tree42e535f9699607b96c74f4bc881bcbb804f12657 /exwm-layout.el
parent12e2d574c916ec7b93b645c0d0bf2e1fb0ce342a (diff)
Fix floating X window bugs introduced by 9c95c03e
* exwm-floating.el (exwm-floating--set-floating): Make floating frames
invisible before resizing them.
(exwm-floating--fit-frame-to-window): Removed since unused.
* exwm-layout.el (exwm-layout-hide-mode-line, exwm-layout-show-mode-line):
Use set frame height instead of exwm-floating--fit-frame-to-window.

* exwm-core.el (exwm-mode): Replace `exwm-manage--close-window' with
`exwm-manage--kill-buffer-query-function'.
* exwm-floating.el (exwm-floating--unset-floating): Reparent out floating
frames.
* exwm-manage.el (exwm-manage--unmanage-window): Reparent out floating
frames.  Hide floating frames.
(exwm-manage--close-window, exwm-manage--kill-buffer-query-function):
Rename `exwm-manage--close-window' since it's only used in
`kill-buffer-query-functions'.  Reparent out floating frames.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el29
1 files changed, 18 insertions, 11 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index a70cf1b012d0..52a84b0fe1fd 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -396,13 +396,18 @@ See also `exwm-layout-enlarge-window'."
   "Hide mode-line."
   (interactive)
   (when (and (eq major-mode 'exwm-mode) mode-line-format)
-    (setq exwm--mode-line-format mode-line-format
-          mode-line-format nil)
-    (if (not exwm--floating-frame)
-        (exwm-layout--show exwm--id)
-      (exwm-floating--fit-frame-to-window)
-      (xcb:flush exwm--connection)
-      (setq window-size-fixed exwm--fixed-size))))
+    (let (mode-line-height)
+      (when exwm--floating-frame
+        (setq mode-line-height (window-mode-line-height
+                                (frame-root-window exwm--floating-frame))))
+      (setq exwm--mode-line-format mode-line-format
+            mode-line-format nil)
+      (if (not exwm--floating-frame)
+          (exwm-layout--show exwm--id)
+        (set-frame-height exwm--floating-frame
+                          (- (frame-pixel-height exwm--floating-frame)
+                             mode-line-height)
+                          nil t)))))
 
 (defun exwm-layout-show-mode-line ()
   "Show mode-line."
@@ -412,10 +417,12 @@ See also `exwm-layout-enlarge-window'."
           exwm--mode-line-format nil)
     (if (not exwm--floating-frame)
         (exwm-layout--show exwm--id)
-      (exwm-floating--fit-frame-to-window)
-      (exwm-input-grab-keyboard)
-      (xcb:flush exwm--connection)
-      (setq window-size-fixed exwm--fixed-size))))
+      (set-frame-height exwm--floating-frame
+                        (+ (frame-pixel-height exwm--floating-frame)
+                           (window-mode-line-height (frame-root-window
+                                                     exwm--floating-frame)))
+                        nil t)
+      (exwm-input-grab-keyboard))))
 
 ;;;###autoload
 (defun exwm-layout-toggle-mode-line ()