about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-02-04T14·38+0800
committerChris Feng <chris.w.feng@gmail.com>2018-02-04T14·38+0800
commit83c0a2db3448091e44cded075104a0b7df636431 (patch)
tree4e625902eac202b285271f0d6e32d042a01317df /exwm-layout.el
parent6b4bfad87bdf8b4cf13cdfb211ae6c8c24c415ff (diff)
Avoid crashing Emacs by resizing its frame into 0x0
* exwm-floating.el (exwm-floating--do-moveresize):
* exwm-layout.el (exwm-layout-enlarge-window): Resizing a frame into
0x0 crashes Emacs so additional checks are required.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 5177ef5bcd95..bcf9c3a67f52 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -470,7 +470,7 @@ windows."
               (setq width nil)
             (setq width (max (+ exwm--normal-hints-min-width margin)
                              (+ width delta))))))
-      (when width
+      (when (and width (> width 0))
         (setf (slot-value exwm--geometry 'width) width)
         (xcb:+request exwm--connection
             (make-instance 'xcb:ConfigureWindow
@@ -503,7 +503,7 @@ windows."
               (setq height nil)
             (setq height (max (+ exwm--normal-hints-min-height margin)
                               (+ height delta))))))
-      (when height
+      (when (and height (> height 0))
         (setf (slot-value exwm--geometry 'height) height)
         (xcb:+request exwm--connection
             (make-instance 'xcb:ConfigureWindow