From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: How to debug emacs repaint problems? Date: Sat, 14 Oct 2023 23:29:01 +0200 Message-ID: <875y38ki5e.fsf@tanaka.verona.se> References: <87fs2duld0.fsf@tanaka.verona.se> <83jzrpqam9.fsf@gnu.org> <871qdxugud.fsf@tanaka.verona.se> <878r85t1dk.fsf@tanaka.verona.se> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2010"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 14 23:30:49 2023 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 1qrmDh-0000NF-HU for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Oct 2023 23:30:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrmCi-0002US-Ju; Sat, 14 Oct 2023 17:29:48 -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 1qrmCg-0002UJ-U2 for emacs-devel@gnu.org; Sat, 14 Oct 2023 17:29:47 -0400 Original-Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrmCb-0004Sn-Ad for emacs-devel@gnu.org; Sat, 14 Oct 2023 17:29:46 -0400 Original-Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 40E0C2FB0B9E for ; Sat, 14 Oct 2023 23:29:06 +0200 (CEST) Original-Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 319642E2F8DB; Sat, 14 Oct 2023 23:29:06 +0200 (CEST) Original-Received: from s473.loopia.se (unknown [172.22.191.6]) by s980.loopia.se (Postfix) with ESMTP id 301382201598; Sat, 14 Oct 2023 23:29:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se Original-Received: from s980.loopia.se ([172.22.191.5]) by s473.loopia.se (s473.loopia.se [172.22.190.13]) (amavisd-new, port 10024) with LMTP id qkK0KZBu_pke; Sat, 14 Oct 2023 23:29:01 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: joakim@alicantealmeria.se X-Loopia-Originating-IP: 193.234.148.196 Original-Received: from tanaka.verona.se (unknown [193.234.148.196]) (Authenticated sender: joakim@alicantealmeria.se) by s980.loopia.se (Postfix) with ESMTPSA id 6363F2201630; Sat, 14 Oct 2023 23:29:01 +0200 (CEST) In-Reply-To: <878r85t1dk.fsf@tanaka.verona.se> (joakim@verona.se's message of "Sat, 14 Oct 2023 22:06:31 +0200") Received-SPF: pass client-ip=93.188.3.37; envelope-from=joakim@verona.se; helo=smtp.outgoing.loopia.se X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:311459 Archived-At: joakim@verona.se writes: > joakim@verona.se writes: > > >> Eli Zaretskii writes: >> >>>> From: joakim@verona.se >>>> Date: Sat, 14 Oct 2023 20:09:31 +0200 >>>> >>>> Hello, >>>> >>>> I have a long standing problem where it appears that my build of emacs >>>> seems to invalidate a lot of regions on screen, which leads to flicker >>>> in my setup of vnc. >>>> >>>> This flicker problem doesnt appear so much in the emacs that is >>>> installed by my distro, which is fedora, emacs 28. >>>> >>>> It would be easier to debug this if emacs could be persuaded to give >>>> some visual hints of which regions its invalidating. Is this possible? >>> >>> Not AFAIU, since Emacs doesn't invalidate any regions. It decides by >>> itself which parts of the screen need to be redrawn, and then does >>> that. >> >> If so, it appears to me that my build of emacs redraws a lot of regions >> unecessarily. So the my question is if its possible to make Emacs show >> some hints of which areas its redrawing. Then I would know if the >> problem is in emacs, or elsewhere. >> >> The emacs 28 in my distro doesnt flicker, nor does apps such as gedit. >> >>> >>>> I use these settings in turbovnc: >>>> Tight+Low quality jpeg(WAN) >>>> /opt/TurboVNC/bin/tvncconfig -set ALR=1 >>>> /opt/TurboVNC/bin/tvncconfig -set ALRAll=true >>>> >>>> The idea is that a low quality codec should be used to refresh >>>> invalidated rects, and then after a while be losslessly refreshed. >>>> This works well in applications that dont invalidate the entire window, >>>> when only small parts of the window needs to be changed. >>> >>> I don't know anything about turbovnc, but what you say is not how >>> Emacs display works. >>> >>> Btw, does the flickering happen with text-mode frames or GUI frames? >>> And which part(s) of the Emacs display flicker? > > I managed to make a screenshot that shows the problem. In the image I > made an emacs window with some black text on red background. > > If I move the cursor just one line, you can see that 2 large regions > become blurred. Since I just moved the cursor one line down, its rather > confusing why these 2 seemingly unrelated regions should be redrawn. > For fun, I made the same test with emacs 29 from flatpak: flatpak run org.gnu.emacs -Q and I get the same problem, with the above testcase, black text against red background. So the only emacs I have which avoids this issue, is an distro built emacs 28. > > >> >> - If I access the same emacs instance in a tty, it does not flicker. >> >> - only gui frames flicker >> >> - the text flickers in a region around the cursor when moving it, it >> seems not consistent. >> >> To be a little bit more elaborate: >> >> - I open a file or an emacs application which has a lot of colors when >> font locked. The colors matter, because when using low quality jpeg >> encoding for vnc, red colors in text is more obviously "bleeding". >> >> - if i wait a little bit, a lossless refresh occurs, and all text is now >> crisp regardless of color. so far so good. >> >> - if I know move the cursor to a new line the line will need to be sent >> by vnc to the client, because there was a cursor drawn there. Therefore >> the line will flicker, and this is expected. >> >> - However, I dont expect other regions in the emacs frame to be needed >> to be sent again, because nothing happened there. But in my case >> random parts of the emacs window seems to be redrawn, and thus >> flicker. And again, this doesnt seem to happen with the distro emacs. -- Joakim Verona joakim@verona.se