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: Gerd Möllmann
Subject: Re: Question about minibuffer and child frames (Posframe)
Date: Mon, 07 Oct 2024 16:24:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

martin rudalics <rudalics@gmx.at> writes:

>>> 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.

Thanks, that makes it clear what you mean with paying. Sorry, I wasn't
sure. 

> 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.  

Yes, that was why I excluded that possibility in my attempt with
border-width and so on, and chose (2) only that I failed to get that
working in the "normal" way (FRAME_BORDER_WIDTH etc.).

> 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.

What I do now, the WM-like approach if you will, is to draw the border
with clipping. Parts of the borders that are outside of the terminal are
not drawn, likewise for the child frames themselves. I don't clip
grandchildren to their parents though. For exmaple a Corfu candidates
window, or a Transient posframe or something like that.




reply via email to

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