From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: Emacs GTK scroll-bar flickering Date: Tue, 18 Mar 2003 23:15:04 +0100 (CET) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200303182319.h2INJ0bP024745@stubby.bodenonline.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1048026553 4945 80.91.224.249 (18 Mar 2003 22:29:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Mar 2003 22:29:13 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 18 23:29:11 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18vPa3-0001HV-00 for ; Tue, 18 Mar 2003 23:29:11 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18vPaV-0008OW-00 for ; Tue, 18 Mar 2003 23:29:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vPYU-0004GO-01 for emacs-devel@quimby.gnus.org; Tue, 18 Mar 2003 17:27:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18vPXz-0003oa-00 for emacs-devel@gnu.org; Tue, 18 Mar 2003 17:27:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18vPXi-0003az-00 for emacs-devel@gnu.org; Tue, 18 Mar 2003 17:26:48 -0500 Original-Received: from stubby.bodenonline.com ([193.201.16.94]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vPXb-0003EM-00; Tue, 18 Mar 2003 17:26:39 -0500 Original-Received: from accessno42.bodenonline.com (IDENT:root@accessno42.bodenonline.com [193.201.16.44]) h2INJ0bP024745; Wed, 19 Mar 2003 00:19:07 +0100 In-Reply-To: "from Miles Bader at Mar 18, 2003 03:15:25 pm" Original-To: Miles Bader X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12449 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12449 > > 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: > [deleted] 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.