From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Q: child frames on ttys
Date: Fri, 30 Aug 2024 08:42:00 +0200 [thread overview]
Message-ID: <m27cby7brb.fsf@pro2.fritz.box> (raw)
In-Reply-To: <m2msl6gk5v.fsf@pro2.fritz.box> ("Gerd Möllmann"'s message of "Wed, 21 Aug 2024 14:00:44 +0200")
[-- Attachment #1: Type: text/plain, Size: 2823 bytes --]
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> * What we have
>>
>> Child frames are created with the =parent-frame= frame parameter on
>> GUIs. This parameter can be changed at any time to create a hierarchy
>> of child fremes. It can be reset to make a frame a non-child frame.
>>
>> A terminal's =tty_display_info= contains a =top_frame= member which is the
>> topmost frame in z-order, where z-order is a bit misleading because
>> all frames currently occupy the whole terminal screen. IOW making a
>> frame the topmost frame obsures all other frames.
>>
>> Redisplay considers topmost frames only (more than one for multiple
>> terminals).
>>
>> The function =frame-restack= can be used to change the z-order of
>> frames. It currently does not handle tty frames.
>>
>> =frame-list= contains child frames.
>>
>> * Terminology
>>
>> A =root frame= is a frame with no parent frame. It always occupies the
>> whole terminal.
>>
>> * Steps
>>
>> 1. Let frames have arbitrary ~(x, y, w, h)~ except for root frames,
>> which have ~(0, 0, terminal-width, terminal-height)~. Change
>> =frame-geometry=.
>>
>> 2. Give root frames a =child_frames= list which is in z-order, topmost
>> last. Add a =tty-frame-restack= which acts on this list.
>>
>> 3. In =redisplay_internal=, act only on root frames. Generating desired
>> glyphs generates glyphs for the root frame, then child frames in
>> z-order, topmost last, i.e. in the order of =frame::child_frames=.
>>
>> 4. Making a frame visible means making all children frames visible.
>>
>> 5. Do not clear the terminal, unless switching to another root frame.
>>
>> 6. Update: Build frame matrices for all windows visible on a terminal.
>> Copy visible parts of child fraem desired glyphs to root frame
>> desired glyphs. Then write to the screen.
>>
>> 7. After writing to the screen, copy visble parts of root frame
>> current glyphs to current glyphs of children.
>
> Changed this to:
>
> 7. After writing to the screen, for all child frames that were
> displayed, update current matrices from desired matrices. There is
> no need to copy glyphs from the root frame since we have them already in
> the desired matrix.
>
>> 8. Add something like =ns-frame-list-z-order= for ttys.
>>
>> * Don't
>>
>> 1. Allocate child frame glyphs from a common pool. Reason is clipping.
>> Don't want to change glyph generation in redisplay to take clipping
>> into account. It's not worth the effort.
So, this seems to work, at least in principle. Where in principle means
I didn't try much yet, but it looks like I can at least display
overlapping child frames.
[-- Attachment #2: Screenshot 2024-08-30 at 08.40.01.png --]
[-- Type: image/png, Size: 479492 bytes --]
[-- Attachment #3: Type: text/plain, Size: 528 bytes --]
I have a question regarding the child frame feature in general though.
As I said before, I want to use them for Corfu and Posframe, the latter
with Vertico and Transient. But the child frame feature looks like
something much more general, more like a general MDI feature, as opposed
to SDI. And my question is: Is that actually used somewhere? In some
package, or in Emacs itself? If it is, I'd be grateful for a pointer.
(Background is of course that I'm trying to assess how much work is
ahead, and if I want to do it :-).
next prev parent reply other threads:[~2024-08-30 6:42 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-17 7:24 Q: child frames on ttys Gerd Möllmann
2024-08-17 10:39 ` Eli Zaretskii
2024-08-17 11:02 ` Gerd Möllmann
2024-08-17 17:18 ` martin rudalics
2024-08-17 18:41 ` Gerd Möllmann
2024-08-21 7:10 ` Gerd Möllmann
2024-08-21 7:55 ` martin rudalics
2024-08-21 8:03 ` Gerd Möllmann
2024-08-21 8:11 ` Robert Pluim
2024-08-21 8:38 ` Gerd Möllmann
2024-08-21 12:00 ` Gerd Möllmann
2024-08-30 6:42 ` Gerd Möllmann [this message]
2024-08-30 9:17 ` martin rudalics
2024-08-30 11:03 ` Eli Zaretskii
2024-08-30 11:23 ` Gerd Möllmann
2024-08-30 14:53 ` Eli Zaretskii
2024-08-31 8:26 ` Gerd Möllmann
2024-08-31 11:54 ` Eli Zaretskii
2024-08-31 14:00 ` Gerd Möllmann
2024-08-31 14:40 ` Eli Zaretskii
2024-09-02 8:37 ` Gerd Möllmann
2024-09-02 11:38 ` Eli Zaretskii
2024-09-02 12:46 ` Gerd Möllmann
2024-09-02 13:13 ` Eli Zaretskii
2024-09-02 13:54 ` Gerd Möllmann
2024-08-30 11:09 ` Gerd Möllmann
2024-08-30 9:29 ` Robert Pluim
2024-08-30 11:19 ` Gerd Möllmann
2024-08-30 12:00 ` Robert Pluim
2024-08-30 12:37 ` Gerd Möllmann
2024-08-30 21:11 ` Dmitry Gutov
2024-08-31 6:45 ` Eli Zaretskii
2024-08-31 8:46 ` Po Lu
2024-09-01 0:27 ` Dmitry Gutov
2024-09-16 1:35 ` Dmitry Gutov
2024-09-01 0:27 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m27cby7brb.fsf@pro2.fritz.box \
--to=gerd.moellmann@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).