unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: emacs devel <emacs-devel@gnu.org>
Subject: Re: Addition to emacsbug.el
Date: Wed, 27 Oct 2004 21:37:01 +0200	[thread overview]
Message-ID: <417FF8DD.1000408@swipnet.se> (raw)
In-Reply-To: <jwv3c00gvjn.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>I'm working on the GTK scroll bars again, trying to get overscrolling to
>>work as in the native scroll bars.  But I see that depending on what GTK
>>version and what X server version I run on (specifically with DAMAGE
>>extension or not), I sometimes get different behaviour.  Therefore I would
>>like to have this information inserted by report-emacs-bug.  The GTK version
>>is already in emacs-version, so I propose this patch to emacsbug.el:
> 
> 
> BTW, with the Xaw3d scrollbars (which had/have the same problem), I've been
> using the following trick very happily:
> - use the "normal" thumb position and size (the same as was used for the
>   non-toolkit scroll bars).
> - at the beginning of a thumb-drag, set the thumb size to 0.
> - at the end of a thumb-drag reset the thumb-size to its real value.
> 
> I find this to be the best solution to the problem: from the code's point of
> view, it's clean and simple (much cleaner and simpler than the hacks that
> are currently used in xterm.c).  From the user's point of view, it makes
> dragging a bit strange at first because the thumb almost disappears under
> the mouse cursor, but to make up for it, the actual behavior during dragging
> is now flawless and so is the rest of the behavior.

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.

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.  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.

> Since we can't have a perfect behavior I find this trade off to be much
> better than anything I've seen so far.

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.

Say you have a buffer with two pages, and if one page is visible the thumb is 
half the size of the window.  You drag down the thumb to the bottom, so that 
the top of page two is at the top of the window.  If you drag down further, the 
thumb shrinks until the bottom of page two is at the top of the window.  The 
thumb in this case shrinks to a minimum of a third of the window height (2 real 
pages and one virtual).

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.

I have a test program that does just this for GTK, but it is one thing to write 
a pure GTK program and another to get the same behaviour in Emacs.  I hope it 
can be done.  Also, I haven't tested with complicated themes yet.

	Jan D.

  reply	other threads:[~2004-10-27 19:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27  9:37 Addition to emacsbug.el Jan D.
2004-10-27 13:27 ` Stefan Monnier
2004-10-27 19:37   ` Jan D. [this message]
2004-10-27 20:50     ` Stefan Monnier
2004-10-28  6:21       ` Jan D.
2004-10-28 19:54         ` Stefan
2004-10-29  9:37           ` Jan D.
2004-10-29 12:28             ` Jan D.
2004-10-29 21:17             ` Stefan
2004-10-30 15:01               ` Jan D.
2004-10-30 16:53                 ` Stefan
2004-10-30 17:17                   ` Jan D.
2004-10-28  6:24 ` Richard Stallman
2004-10-28  8:07   ` Jan D.

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=417FF8DD.1000408@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --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).