From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Emacs canvas support Date: Thu, 30 Apr 2020 16:46:57 +0300 Message-ID: <831ro5xezy.fsf@gnu.org> References: <83o8raziis.fsf@gnu.org> <877dxy1smz.fsf@yahoo.com> <87o8rae0ao.fsf@randomsample> <83lfmexmfp.fsf@gnu.org> <20200429171619.GB20842@tuxteam.de> <83imhixkva.fsf@gnu.org> <20200429185128.GA27164@tuxteam.de> <83ees6xggr.fsf@gnu.org> <20200429190854.GC27164@tuxteam.de> <83a72uxffz.fsf@gnu.org> <20200429195930.GA29703@tuxteam.de> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="108635"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tomas@tuxteam.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 30 15:56:18 2020 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 1jU9fd-000Ru3-Mi for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Apr 2020 15:56:09 +0200 Original-Received: from localhost ([::1]:40584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU9fc-00068U-N1 for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Apr 2020 09:56:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50720) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU9Wz-0006Sl-Ul for emacs-devel@gnu.org; Thu, 30 Apr 2020 09:49:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49033) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU9Wy-000871-TJ; Thu, 30 Apr 2020 09:47:12 -0400 Original-Received: from [176.228.60.248] (port=1270 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jU9Wy-0001wD-BP; Thu, 30 Apr 2020 09:47:12 -0400 In-Reply-To: (message from Stefan Monnier on Wed, 29 Apr 2020 21:19:51 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:248235 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , emacs-devel@gnu.org > Date: Wed, 29 Apr 2020 21:19:51 -0400 > > I think it would make more sense to treat the overlaid canvas as > a completely separate pixmap: when we get an request to redraw > a particular area of the screen, we'd ask the current redisplay code to > redraw the corresponding text content and then we'd ask the canvas code > to draw on top of it. Unfortunately, most redisplay cycles don't start from a request to redraw a particular area of the screen. This only happens when we get expose events from the WM, which is not the "normal" trigger of redisplay. Usually, redisplay is entered when Emacs is idle, and it's one of the display engine's main jobs to figure out what parts of which windows need to be redrawn, by just considering the changes in buffer text, their properties/overlays, and window geometry and starting point. In doing so, the display engine need to know, up front, which parts of the display reside where on the screen, whether any of them needs to be redrawn because the underlying Lisp data was modified by some command since the last redisplay. So AFAIU it won't work to redraw the "canvas" only when the text beneath it changes; the display engine needs to be able to redraw the canvas itself even if the text didn't change, and it needs to know which portions of the window are affected by the canvas in order to make decisions regarding how to redraw the window optimally.