From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Q: child frames on ttys Date: Wed, 21 Aug 2024 09:10:41 +0200 Message-ID: References: <86ikvz302s.fsf@gnu.org> <132fd5ff-bcdf-4d93-acab-186e52f80d9a@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19088"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 21 09:11:46 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sgfVS-0004pb-05 for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Aug 2024 09:11:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgfUX-0007xq-Na; Wed, 21 Aug 2024 03:10:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgfUV-0007xT-D2 for emacs-devel@gnu.org; Wed, 21 Aug 2024 03:10:47 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgfUS-0001f5-Nm; Wed, 21 Aug 2024 03:10:47 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso9609279a12.1; Wed, 21 Aug 2024 00:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724224242; x=1724829042; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1MYkOqbXzhETuPGzFtVyce/qncqEfbwiAjc/DtQtETI=; b=S7PDsowwLzoRpx6L2eZ6+k5iG2gH64A3DWqqO1N2b6lFBEGHqsKhbtoWR/obeXjylU NqmAkVWjj8nlcZy25klWFbZYN11kLzDmzGLGpBuGnmqeKPDAjJShN0HnwiKoKwQelT/+ mIgcEw2zUcMk/LIn5jhSqp1kCW3NnpzN9tVltc+o0isaC1J+/0bAAs2NpLtFGw+v9nx6 UhvVfbtEgF9sidlYWXKMlSTrEiLOIe9Kdg0RLgv5mJioUC73o+XyEVaJvPbqghtFn7gQ kfUqKML+QhpVmohSVW3y29QU3geBuM2RnjCvouyoxs/YIGU+XLLCN+tjArGAQHx4LfRC xlBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724224242; x=1724829042; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1MYkOqbXzhETuPGzFtVyce/qncqEfbwiAjc/DtQtETI=; b=D4uB+wD3CxokaA6hV67L4oEaVRuCzChZs2/X/iO5tXYPQy0icNlxDFANo2LqH5p4cX h6nAi6Rvpvf9t8xW3/XTyRPWJVdT2KqNkQVAZeQxtmfvKoVOrwrshxg4rmUxney5ut/w yV0dYEiOmXjn+O2qcRUSuylB8udv9aKAl7pSdiAR1IPBw+3FBBG2ssy7K0tstalXgNVW xY9huULjp3xu7qQhO4rjQ/z921JznSwBa39c2VFGtU1vckW9TbYYNGL0aVc1L8CKkltD ELpsWvyqHIFFQ0J0B34CYn+mRMtX2QmD3Ff/wGNS1WcRrjlE45BNqhjq1yZEMWUd+wBf Y5vg== X-Forwarded-Encrypted: i=1; AJvYcCWQsu9tvHzltNxUyfGE3JsJ9KQiaU4/J8v4j/98FOEBfWQgLJ3N3r7t7u8rMfmUxHwAUvhzT0179xr9Kg==@gnu.org X-Gm-Message-State: AOJu0YyIC8NeLtH5PJXzcNyvsCvAcN3Z7C4kWxkRj2ROLCYTQrHnS7C6 wbqUvGEye4vnDNrl/dOlG1mhg/6HL2igN/j6Qt/tMxExBePsNW6HxUlhVQ== X-Google-Smtp-Source: AGHT+IGkd68vbqd+O+zD4JMZQvE+ORKPLVr7bfJvprONgBUdpaWHGo2Qmqm5GzDbOSn7cm7j+kJIXQ== X-Received: by 2002:a05:6402:5210:b0:5be:fcae:aa6b with SMTP id 4fb4d7f45d1cf-5bf1f0b40d0mr987863a12.5.1724224242228; Wed, 21 Aug 2024 00:10:42 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3ae30.dip0.t-ipconnect.de. [79.227.174.48]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5becd9d53e2sm6519339a12.38.2024.08.21.00.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 00:10:41 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sat, 17 Aug 2024 20:41:43 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322991 Archived-At: Gerd M=C3=B6llmann writes: >> It was discussed in some length in a thread "Implementing child frames >> on terminal" starting here >> >> https://lists.nongnu.org/archive/html/emacs-devel/2022-07/msg00301.html >> >> but IIRC nothing ever came out of it. >> >> martin > > Thanks for the pointer, Martin! I've taken a look today, and I think the tty stuff is in principle still like it was when I wrote it, plus some additions like multi-tty of course. Anyway, I think the below would be a viable plan how to add child frames for ttys. Or a very rough first approach. Any comments? Did I overlook something important? * What we have Child frames are created with the =3Dparent-frame=3D 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 =3Dtty_display_info=3D contains a =3Dtop_frame=3D 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 =3Dframe-restack=3D can be used to change the z-order of frames. It currently does not handle tty frames. =3Dframe-list=3D contains child frames. * Terminology A =3Droot frame=3D 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 =3Dframe-geometry=3D. 2. Give root frames a =3Dchild_frames=3D list which is in z-order, topmost last. Add a =3Dtty-frame-restack=3D which acts on this list. 3. In =3Dredisplay_internal=3D, 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 =3Dframe::child_frames=3D. 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. 8. Add something like =3Dns-frame-list-z-order=3D 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.