emacs-devel
[Top][All Lists]
Advanced

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

Re: XEmbed patches


From: Stephen J. Turnbull
Subject: Re: XEmbed patches
Date: Fri, 20 Jul 2007 21:28:34 +0900

Jason Rumney writes:

 > And can Emacs switch this behaviour [of sizing in character units]
 > on and off at will?

[All windows below are window-system windows, not Emacs windows, which
are irrelevant here.]

It doesn't work that way, not if Emacs is an ICCCM-conformant
application.  The window manager tells Emacs, in pixels, where and how
big its windows are going to be, and it has the power to enforce this
(by reparenting Emacs's top-level window as a subwindow of a window it
owns, and clipping Emacs's window to the window manager's preferred
geometry).  It's Emacs's problem to fit into that space.  If Emacs
wants to, it can make its window arbitrarily big (up to the limit
imposed by the size of the X.h Dimension typedef, often 16 bits), but
the user will still only see that part that fits into the space
provided by the window manager.

If Emacs's desired window is smaller than what it is given, any "slop"
will have to be dealt with.  An image viewer might prefer to center
its display, but typically a text application will align the top-left
corner of the top-left character's bounding box with the origin
(top-left) of the window.  The right side is typically ragged, so a
few pixels there will be unnoticed, and (if the text extends that far)
the bottom line is typically displayed, and then clipped to the window
provided.

The use of character size (which is an arbitrary pair of dimensions
selected by the programmer, doesn't need to correspond to an actual
character cell) is purely a convenience for the user.  A window
manager can, but need not, respect the nominal character grid.  That's
entirely up to the window manager.  Especially in full-screen
maximization, window managers often choose to ignore the grid.  And
for GUI apps the grid is kinda silly anyway, since it's unlikely that
the decorations will be integral multiples of the font size (which may
not determine interlinear spacing in the presence of faces or images,
anyway).

Presumably the XEmbed parent has similar power, and Emacs can deal
with it in pretty much exactly the same way that it deals with the
window manager.  Just remember these words: "Yes, Boss!" and you'll
get along with the typical window manager just fine.<wink>

 > If the user selects a variable width font as the default font, then
 > the character increment is not very useful.

Sure it is.  Variable width fonts still have a consistent height, and
you can assume the standardized aspect ratio of 2:1.  This is
noticably wider than would correspond to 80-character lines in most
proportional fonts, but it's usually far better to underestimate the
number of characters that will fit in the window than to overestimate.




reply via email to

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