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: Mon, 02 Sep 2024 14:46:11 +0200 Message-ID: References: <86ikvz302s.fsf@gnu.org> <132fd5ff-bcdf-4d93-acab-186e52f80d9a@gmx.at> <86jzfye0hf.fsf@gnu.org> <86ikvgc3gz.fsf@gnu.org> <86cylobvse.fsf@gnu.org> <86y14a8eut.fsf@gnu.org> 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="15656"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 02 14:47:01 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 1sl6ST-0003wt-9n for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Sep 2024 14:47:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sl6Rq-0002j8-A2; Mon, 02 Sep 2024 08:46:22 -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 1sl6Rn-0002iu-Tb for emacs-devel@gnu.org; Mon, 02 Sep 2024 08:46:19 -0400 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sl6Rm-0002S7-33; Mon, 02 Sep 2024 08:46:19 -0400 Original-Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a86b64ebd8aso258738966b.1; Mon, 02 Sep 2024 05:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725281176; x=1725885976; 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=svIuBDkBUay/j55k+EC3Ascmw9ZZEVmQuo9ZWRqt/bg=; b=Esakvh6ZDiJT8DMob6PPnbZO2lf4z8FT8fgdLpiaH6bCFJK8QVMkMw8e30wLnVM0C2 HgRKJVIdsoX1za78hZPEJsbsWJJh8vVqxkCuclHvnuueHJIMxmfG+5KGms7r9A/cWfkT k0V/GWjw71EHALpfoYN2K/Q86fKpMuHqRwTHGIbrLkJ78IZfGikS2XfHxVscRgBHDgvU GhKPIeCYDfzcvhSs7nEcXzNWIAz+fYzrlcq9vD5JHcAAy2WyIl1V5j8OWzASEMnppZJC DzJoYPNUNlBNLT7YuX5AWqGThq2bgMEu8SHmwscMCIUo47Fy5NV2blUhxqIPNDXsshl6 mymQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725281176; x=1725885976; 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=svIuBDkBUay/j55k+EC3Ascmw9ZZEVmQuo9ZWRqt/bg=; b=VlV0kJL17fVpPcpRXb7zZNZZN5jh+Fjl3bOW0QyG/4L9LWhbmhzOBK1WqKg6lMA2B4 u7iKhXB10tIpUpG6uxvs2bM99ne/q4/3+Nph+KBIYSATE2a0lphbrMPGM7NQ4+3d1203 nWDB8QFcrA8zsNn+4fcCIYJP0WpZpVshM/5i/G8O+DrZgxqABf3N27VJ0dEbeXAOqAN+ 70BtkyIEguyCBcKLYJj6GRqeCAxSqHg4j6v6PKn/6Bk3ZNlgsBPPGSjKBOrCbLo0aGar xeCWZ0pMdwLOeZDNC/xEEYnEJfBhv6tC2b6Qwelkak1nxtoo3MPJJCwL98PShH89qWMj 3ULA== X-Forwarded-Encrypted: i=1; AJvYcCXbITih3vSC+Tjx24wcqrsqKGj7zvDh2Jk+msT95dfnAyL+ZgWQcWXWLWpdHYdIIAhKU747e6YCazYSvg==@gnu.org X-Gm-Message-State: AOJu0YxfzLbQNCV4DVWMvmglOORcbHUVtKpMC5AM3q8kM0XgNLPgA25X /LgSX8LqUTQIR8YpRb0yh6xnjwSJj0WMOECwvfyhMnAGd/R6qWi7PLY/jg== X-Google-Smtp-Source: AGHT+IFQh5dNmnP481IeI4nnCQL1fehupTRluQA81qB30d4Tv9BbBU/qe5yjXQnl7MkLu00R0Ermkg== X-Received: by 2002:a05:6402:d08:b0:5c2:1803:ac65 with SMTP id 4fb4d7f45d1cf-5c21ed54d08mr12891311a12.21.1725281175416; Mon, 02 Sep 2024 05:46:15 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a928.dip0.t-ipconnect.de. [79.227.169.40]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c251a8719fsm2041414a12.31.2024.09.02.05.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 05:46:13 -0700 (PDT) In-Reply-To: <86y14a8eut.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Sep 2024 14:38:50 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:323285 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: rudalics@gmx.at, emacs-devel@gnu.org >> Date: Mon, 02 Sep 2024 10:37:37 +0200 >>=20 >> Just wanted to mention that I had an idea yesterday how to solve that >> problem without making broad changes outside of the tty code. The idea >> is to write a function that maps an (x, y) position in a >> matrix the frame holding the realized face at that position. > > Sorry, I don't understand: a function mapping a position to what? > 'struct face'? If so, and unless the function is cheap enough, > wouldn't that make redisplay slower? Yes, in th4 end it's a struct face, that's right. And it's pretty cheap. Of course famous last words and so on. I haven't implemented it yet. And it affects tty frames only which I find nice. The thing is intended to work like this: Suppose we have only one root frame and a number of overlapping child frames on top of it. All these frames are considered independent of each other like on a GUI. Each frame has its own frame matrices. For each frame we build window matrices as usual, and for each frame we build the corresponding frame matrix. New is building the frame matrix and writing to the terminal are separated from each other. Writing to the terminal happens only for the root frame, after first combining all the frame matrices we deal with by copying glyphs from the child matrices, in reverse z-order. The combination step computes z-order and the intersection rectangles of child frames with the root frame to know what to copy where. That's how I do it now. The new plan is to record these rectangles as a list of (child-frame rectangle). Probably not Lisp lists, don't know. Now, when writing glyphs at some cursor position (x y), we call turn_on_face (frame, face_id), where face_id comes from some glyph. We consult the list above, and determine the topmost in z-order child-frame from which this glyph was copied, if it was. That frame contans the face cache for the face_id of the glyph.=20 When there are no child frames, the list is empty, and it boils down to a function call instead of simply using FACE_FROM_ID. I'd say that's cheap. If there are N child frames, we have to test N times in the worst case if (x y) in inside a given rectangle, which is 4 integer comparisions each. And N will be small, typically N =3D 1. Seems workable to me, but one has to wait and see of course.