emacs-devel
[Top][All Lists]
Advanced

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

set-frame-height glitch [Was: Re: Changes in frame/window code]


From: Dmitry Antipov
Subject: set-frame-height glitch [Was: Re: Changes in frame/window code]
Date: Wed, 23 Jul 2014 19:05:10 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/23/2014 04:48 PM, martin rudalics wrote:

With emacs -Q and an internal tool bar evaluate one after the other

(frame-height)
(set-frame-height nil (1+ (frame-height)))
(frame-height)

Here the `set-frame-height' shrinks the frame.

Nice shot.  But, IIUC, this means that set-frame-height goes wrong
but should be:

=== modified file 'src/frame.c'
--- src/frame.c 2014-07-21 16:58:12 +0000
+++ src/frame.c 2014-07-23 15:01:44 +0000
@@ -2584,8 +2584,11 @@
     {
       if (NILP (pixelwise))
        {
-         if (XINT (height) != FRAME_LINES (f))
-           x_set_window_size (f, 1, FRAME_COLS (f), XINT (height), 0);
+         int actual = FRAME_LINES (f) - FRAME_TOP_MARGIN (f);
+         int requested = XINT (height) + FRAME_TOP_MARGIN (f);
+
+         if (requested != actual)
+           x_set_window_size (f, 1, FRAME_COLS (f), requested, 0);

          do_pending_window_change (0);
        }

Dmitry




reply via email to

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