emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116742: Two adjustments in window/frame resizing.


From: Martin Rudalics
Subject: [Emacs-diffs] trunk r116742: Two adjustments in window/frame resizing.
Date: Wed, 12 Mar 2014 07:29:01 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116742
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Wed 2014-03-12 08:28:23 +0100
message:
  Two adjustments in window/frame resizing.
  
  * frame.c (x_set_frame_parameters): Always calculate new sizes
  pixelwise to avoid potential loss when rounding.
  * window.el (fit-frame-to-buffer): Get maximum width from
  display's width instead of height.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/window.el                 window.el-20091113204419-o5vbwnq5f7feedwu-94
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/frame.c                    frame.c-20091113204419-o5vbwnq5f7feedwu-243
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-12 07:14:30 +0000
+++ b/lisp/ChangeLog    2014-03-12 07:28:23 +0000
@@ -1,3 +1,8 @@
+2014-03-12  Martin Rudalics  <address@hidden>
+
+       * window.el (fit-frame-to-buffer): Get maximum width from
+       display's width instead of height.
+
 2014-03-12  Glenn Morris  <address@hidden>
 
        * desktop.el (desktop-restore-frames)

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2014-03-07 19:12:31 +0000
+++ b/lisp/window.el    2014-03-12 07:28:23 +0000
@@ -7043,7 +7043,7 @@
                (- (* (nth 2 sizes) char-width) window-extra-width))
               ((numberp max-width)
                (- (* max-width char-width) window-extra-width))
-              (t display-height)))
+              (t display-width)))
             (min-width
              (cond
               ((numberp (nth 3 sizes))

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-03-11 06:50:01 +0000
+++ b/src/ChangeLog     2014-03-12 07:28:23 +0000
@@ -1,3 +1,8 @@
+2014-03-12  Martin Rudalics  <address@hidden>
+
+       * frame.c (x_set_frame_parameters): Always calculate new sizes
+       pixelwise to avoid potential loss when rounding.
+
 2014-03-11  Dmitry Antipov  <address@hidden>
 
        * xfns.c (x_set_mouse_color): Recolor vertical_drag_cursor.

=== modified file 'src/frame.c'
--- a/src/frame.c       2014-02-22 21:49:10 +0000
+++ b/src/frame.c       2014-03-12 07:28:23 +0000
@@ -2848,14 +2848,14 @@
   /* Provide default values for HEIGHT and WIDTH.  */
   width = (f->new_width
           ? (f->new_pixelwise
-             ? (f->new_width / FRAME_COLUMN_WIDTH (f))
-             : f->new_width)
-          : FRAME_COLS (f));
+             ? f->new_width
+             : (f->new_width * FRAME_COLUMN_WIDTH (f)))
+          : FRAME_TEXT_WIDTH (f));
   height = (f->new_height
            ? (f->new_pixelwise
-              ? (f->new_height / FRAME_LINE_HEIGHT (f))
-              : f->new_height)
-           : FRAME_LINES (f));
+              ? f->new_height
+              : (f->new_height * FRAME_LINE_HEIGHT (f)))
+           : FRAME_TEXT_HEIGHT (f));
 
   /* Process foreground_color and background_color before anything else.
      They are independent of other properties, but other properties (e.g.,
@@ -2899,12 +2899,12 @@
       if (EQ (prop, Qwidth) && RANGED_INTEGERP (0, val, INT_MAX))
         {
           size_changed = 1;
-          width = XFASTINT (val);
+          width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ;
         }
       else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX))
         {
           size_changed = 1;
-          height = XFASTINT (val);
+          height = XFASTINT (val) * FRAME_LINE_HEIGHT (f);
         }
       else if (EQ (prop, Qtop))
        top = val;
@@ -2986,15 +2986,15 @@
     Lisp_Object frame;
 
     /* Make this 1, eventually.  */
-    check_frame_size (f, &width, &height, 0);
+    check_frame_size (f, &width, &height, 1);
 
     XSETFRAME (frame, f);
 
     if (size_changed
-        && (width != FRAME_COLS (f)
-            || height != FRAME_LINES (f)
+        && (width != FRAME_TEXT_WIDTH (f)
+            || height != FRAME_TEXT_HEIGHT (f)
             || f->new_height || f->new_width))
-      Fset_frame_size (frame, make_number (width), make_number (height), Qnil);
+      Fset_frame_size (frame, make_number (width), make_number (height), Qt);
 
     if ((!NILP (left) || !NILP (top))
        && ! (left_no_change && top_no_change)


reply via email to

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