unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: joakim@verona.se
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: How to debug emacs repaint problems?
Date: Sat, 14 Oct 2023 21:47:06 +0200	[thread overview]
Message-ID: <871qdxugud.fsf@tanaka.verona.se> (raw)
In-Reply-To: <83jzrpqam9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Oct 2023 22:15:10 +0300")

Eli Zaretskii <eliz@gnu.org> 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?

- 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



  reply	other threads:[~2023-10-14 19:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-14 18:09 How to debug emacs repaint problems? joakim
2023-10-14 19:15 ` Eli Zaretskii
2023-10-14 19:47   ` joakim [this message]
2023-10-14 20:06     ` joakim
2023-10-14 21:29       ` joakim
2023-10-15  5:24       ` Eli Zaretskii
2023-10-15  1:02     ` Po Lu
2023-10-15  5:49       ` Eli Zaretskii
2023-10-15 11:02       ` joakim
2023-10-15 11:49         ` Po Lu
2023-10-15 12:17           ` joakim
2023-10-15 12:43             ` Po Lu
2023-10-15 13:31               ` joakim

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=871qdxugud.fsf@tanaka.verona.se \
    --to=joakim@verona.se \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).