[Top][All Lists]

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

Re: `make-frame' makes taller frame than the specified height

From: Jan D.
Subject: Re: `make-frame' makes taller frame than the specified height
Date: Mon, 11 Jul 2005 17:43:48 +0200
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Richard M. Stallman wrote:

   Is it only to me?  The height of the new frame grows by 3 when
   evaluating the following form:

   (let ((params (frame-parameters (selected-frame))))
     (make-frame (delq (assq 'minibuffer params) params)))

About 10 years ago I tried hard to fix that problem, or a similar
problem.  I debugged a case where the size or position parameters (I
am not sure, but I think it was position) as read didn't quite match
those that were specified, and I fixed the bug by counter-adjusting
them.  Unfortunately there was a different case where the old code was
right and the adjustment was wrong.  I found that out a few months
later, at which point I no longer remembered the details of the first
case, so I had no way to try to determine the difference between the
cases or try to design a system that would work in general.

I think that whole part of Emacs needs to be rewritten by someone
who understands Xt much better than I do, and knows the right way
to do these things.  Until that is done, I think fixing one case
will tend to break another case.

This case is probably different from the case described above. It has to do with the tool bar height. In the GTK version of Emacs the tool bar heigh is not included in the line height (as the tool bar may not be a multiple of the line height). So the given number of lines is what you get.

For other X versions of Emacs (Lucid, Lesstif/Motif and no toolkit) the tool bar height is included, but perhaps not in a manner yopu'd expect. You can see this by turning off the tool bar, and evaluate the Lisp code above. You will now get identically sized frames.

The inconsistency is that when creating a frame, Emacs adds the tool bar height to the frame parameter (say you specified height 40, Emacs adds 3 => 43). This makes sense in that you can specify 40 lines and not have to care about the tool bar height. But the lines in the frame-parameters is now 43. So when you make-frame again, the same thing happens, 43 + 3 => 46. And so on.

In the GTK version a frame parameter height of 40 means there are 40 text lines. But for other X versions, there are only 37 (assuming the tool bar is 3 lines).

Changing this may break other things. The obvious fix is to not add the tool bar height when creating a frame, but this means that everybody who has specified a frame height in their .emacs or .Xdefaults will get a frame that is smaller than previously. Is that a change we can live with? Or is this case so rare that we rather have it as it is now?

   Jan D.

reply via email to

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