[Top][All Lists]

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

Re: Addition to emacsbug.el

From: Stefan Monnier
Subject: Re: Addition to emacsbug.el
Date: Wed, 27 Oct 2004 16:50:07 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> Hmm, I don't like it.  First of all, it is during a thumb-drag that you
> actually look at the thumb and the feedback you get from the size of the
> thumb (how much of the whole we are viewing, and where we currently are) is
> most useful.  Also, the thumb does not always show up under the mouse
> pointer, but often quite a bit from it.  If I continue to drag, the thumb
> jumps to the pointer.  I'd rather keep the current GTK behaviour, with
> a thumb size that includes the empty virtual page, but others may
> feel different.

Well, it's a question of taste, obviously.  I myself introduced the idea of
"empty virtual page" in the Xaw3d code (so if you're looking at a 25 lines
buffer in a 25-lines window, the thumb is only covering half of the
scrollbar).  But after using it for a while I decided I didn't like it
because I was never sure whether there was still something left in the
buffer (typically when reading Gnus messages).  There are various ways to
provide some other visual feedback, but experience showed that the scrollbar
is the feedback that I use.

> Secondly it does not work at all for GTK.  The event from the scroll bar
> stops when the thumb hits the bottom, so overscrolling for a window where
> the whole contents is shown does not happen.

I don't understand what you mean by "it doesn't work".  In the above case,
the thumb would start covering the whole scrollbar, but as soon as the drag
starts you make it size 0, so the user can drag at will and the thumb will
only hit the bottom of the scrollbar when the beginning of the thumb is at
the bottom (i.e. when the last char of the buffer is at the top of the

The problem of not being able to move past the bottom is just the same
in Xaw3d.  Well, was, since AFAIK Xaw3g version 1.5g fixes it (it can be
argued that it was a bug since it didn't follow the Xaw behavior).

> Also, GTK thumbs can not be resized with ease like the Xaw and Motif ones,
> it involves setting the page size and the max and min just right.

Isn't that a small matter of programming (I mean, Emacs does change the size
of the thumb, already, right?).

> It depends on what we consider the perfect behaviour.  My idea (and
> I thought the other versions of Emacs behaved like this already, I don't use
> scroll bars much) is that when the thumb hits the bottom we enter
> overscrolling mode.  In that mode the thumb smoothly shrinks if dragged down
> further, and grows again if dragged up.

Yes, that's exactly what I mean by "perfect behavior", except that your
description only focuses on the scrollbar, whereas one key aspect is how it
relates to the actual buffer text displayed: when the thumb hits the bottom
is when the EOB is displayed.

> I am not sure if there is a general way to do this (resizing of thumbs and
> event handling differ between toolkits), or if it must be done individually
> for each toolkit.  Perhaps if this is done for two toolkits we can then
> rewrite it in a general way.  That would be 22.0 stuff I think.  But as GTK
> is just one toolkit and the scroll code to modify is either all in
> gtkutils.c or #ifdef:ed USE_GTK in xterm, the risc is low.

Currently a fair bit of code is shared, but not all of it.  the current
imperfect solution uses different tricks for different toolkits.

My suggested new imperfect solution is less dependent on details of the
toolkits so it reduces the among of toolkit-specific tweaks.
Check the patch I sent.

BTW, what about the other part of my patch:
merge xg_set_toolkit_scroll_bar_thumb back into
x_set_toolkit_scroll_bar_thumb ?


reply via email to

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