emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116306: Constrain window body sizes.


From: Martin Rudalics
Subject: [Emacs-diffs] trunk r116306: Constrain window body sizes.
Date: Fri, 07 Feb 2014 10:03:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116306
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Fri 2014-02-07 11:03:10 +0100
message:
  Constrain window body sizes.
  
  * window.c (window_body_height, window_body_width): Don't return
  negative value.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/window.c                   window.c-20091113204419-o5vbwnq5f7feedwu-231
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-02-07 09:32:15 +0000
+++ b/src/ChangeLog     2014-02-07 10:03:10 +0000
@@ -1,9 +1,11 @@
 2014-02-07  Martin Rudalics  <address@hidden>
 
-       Constrain window box sizes (Bug#16649).
+       Constrain window box and body sizes (Bug#16649).
        * xdisp.c (window_box_width): Don't return less than zero.
        (window_box_left_offset, window_box_right_offset): Don't return
        more than the window's pixel width.
+       * window.c (window_body_height, window_body_width): Don't return
+       negative value.
 
 2014-02-07  Glenn Morris  <address@hidden>
 

=== modified file 'src/window.c'
--- a/src/window.c      2014-01-22 10:29:23 +0000
+++ b/src/window.c      2014-02-07 10:03:10 +0000
@@ -866,7 +866,11 @@
                - WINDOW_MODE_LINE_HEIGHT (w)
                - WINDOW_BOTTOM_DIVIDER_WIDTH (w));
 
-  return pixelwise ? height : height / FRAME_LINE_HEIGHT (WINDOW_XFRAME (w));
+  /* Don't return a negative value.  */
+  return max (pixelwise
+             ? height
+             : height / FRAME_LINE_HEIGHT (WINDOW_XFRAME (w)),
+             0);
 }
 
 /* Return the number of columns/pixels of W's body.  Don't count columns
@@ -893,7 +897,11 @@
                   ? WINDOW_FRINGES_WIDTH (w)
                   : 0));
 
-  return pixelwise ? width : width / FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w));
+  /* Don't return a negative value.  */
+  return max (pixelwise
+             ? width
+             : width / FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)),
+             0);
 }
 
 DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 2, 0,


reply via email to

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