emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm 83c0a2d: Avoid crashing Emacs by resizing its fram


From: Chris Feng
Subject: [elpa] externals/exwm 83c0a2d: Avoid crashing Emacs by resizing its frame into 0x0
Date: Sun, 4 Feb 2018 09:41:42 -0500 (EST)

branch: externals/exwm
commit 83c0a2db3448091e44cded075104a0b7df636431
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    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.
---
 exwm-floating.el | 4 ++--
 exwm-layout.el   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/exwm-floating.el b/exwm-floating.el
index 9d4e76c..a695346 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -601,8 +601,8 @@ context of the corresponding buffer.")
                                (eval-when-compile
                                  (logior xcb:ConfigWindow:Width
                                          xcb:ConfigWindow:Height)))
-            width (aref result 4)
-            height (aref result 5))
+            width (max 1 (aref result 4))
+            height (max 1 (aref result 5)))
       (setq buffer-or-id (aref result 0))
       (setq container-or-id
             (if (bufferp buffer-or-id)
diff --git a/exwm-layout.el b/exwm-layout.el
index 5177ef5..bcf9c3a 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]