[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs GTK scroll-bar flickering

From: Jan D.
Subject: Re: Emacs GTK scroll-bar flickering
Date: Tue, 18 Mar 2003 23:15:04 +0100 (CET)

> > Emacs probably changes thumb much more than Gedit, as Gedit counts
> > lines visible, but Emacs counts characters.
> That's not the issue, I think -- with exactly the same file and theme,
> I can drag the scrollbar around in Gedit with _no_ flickering or other
> unpleasant artifacts, whereas emacs flickers like crazy in the same test.

It indeed is the issue.  Where Gedit counts the lines in a file and
the lines shown, Emacs counts characters.

When calculating the size of the thumb, one basically divide lines shown
with total lines in file.  When moving about and adding or
deleting characters that does not change the number of lines in the
file, the thumb size does not change.

When lines aren't available, Emacs uses characters instead.  But
every character added or deleted changes the thumb because the ratio
between total number characters in the file and the number of characters
shown changes.  Thus, Emacs updates the thumb a lot more than a
line based application.  When the scroll bar is bad at updating
for small changes like this, flicker occurs.

> Here's an attempt to be a bit more specific about a case wehre I'm
> seeing the problem:


Thanks for this test case.  I can see redraws here.  They all come from
the fact that Emacs updates the thumb often.  This is basically a
GTK problem.  Perhaps we can find some way to not update the thumb
so often.

>  (4) The result I see is:
>     (a) Until your typing reaches the end of the line, the scrollbar is
>         quite stable, with no obvious flickering.
>     (b) When the typing reaches the end of the line, and continues onto
>         the next line, the scrollbar starts flickering obviously, and
>         will continue as you type.

For every character you type, Emacs updates the thumb.
Why it does not do that for the first line must have something to do with
the redraw engine.  It happens for all toolkits.
It is even more noticable if you insert some lines of characters by
holding down a letter and then delete them all by holding down DEL.

>         BTW, another odd thing: in the initial scratch-buffer, the
>         scrollbar thumb doesn't extend all the way to the top and the
>         bottom of the scrollbar, even though the entire is clearly
>         visible.

This is by design.  It is so you can scroll with the scroll bar so the
last line of the buffer is at the top of the frame.

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]