emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about minibuffer and child frames (Posframe)


From: martin rudalics
Subject: Re: Question about minibuffer and child frames (Posframe)
Date: Mon, 7 Oct 2024 15:44:29 +0200
User-agent: Mozilla Thunderbird

>> So the parent pays?  If so, please say that somewhere because it will
>> affect the position of the child frame within the parent.  On a GUI the
>> position is the one specified by the user and the child frame pays for
>> the border (is "affected").
>
> I don't know what you mean by "parent pays".

Whenever you show a border, it will obscure the part of the display that
would be otherwise shown instead.  So someone has to pay for that border
in terms of screen estate that is lost to that border.  For normal GUI
frames it usually doesn't matter - borders are narrow and the loser is
the desktop background.  Maximized and full screen frames usually don't
have a border, so there's no problem at all (IIRC maximized MS Windows
frames did have a border but it was drawn outside the screen).

So basically, these border spaces are payed for by the desktop and
possible other applications when frames overlap.  Some window managers
even make an invisible border around a frame which can be felt when a
user tries in vain to move a window to a position of (0, 0) on the
screen.

With Emacs the situation becomes more complicated because there are up
to three border types: One drawn by the window manager and our own ones
- the one specified by the border_width slot which is hardly ever seen
and the one specified by the internal_border_width slot (the
child_frame_border_width slot for child frames).

Now when you show a child frame on top of a normal frame you have two
ways to draw the internal borders:

(1) Keep the bounding rectangle of the child frame as specified.  In
    this case the child frame pays for the borders since it will have
    less space for showing its text.

(2) Enlarge the bounding rectangle of the child frame.  In this case the
    parent frame pays for the borders since it will have less space for
    showing its text.

On TTY frames drawing borders that are one character wide and high
inflicts the additional problem that in case (1) the size specified by
the application (maybe via 'fit-frame-to-buffer') is not met by what the
user sees.  In case (2) the position specified by the application may
not be met - the left edge of the child frame may overlap an interesting
part of the parent frame.

In addition, (2) may not be entirely easy to realize when the child
frame is positioned at an edge of the parent frame.

martin



reply via email to

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