From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.bugs Subject: bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion. Date: Fri, 04 Jan 2013 14:46:14 +0100 Message-ID: <50E6DD26.3070002@swipnet.se> References: <08F7728F-7C66-4679-B905-E548DDA0E0FA@Freenet.DE> <878v9geh6t.fsf@topper.koldfront.dk> <04F1E5FA-1248-419D-BF2D-CC695CF48C35@swipnet.se> <87r4m7uh4e.fsf@topper.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1357307230 19271 80.91.229.3 (4 Jan 2013 13:47:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Jan 2013 13:47:10 +0000 (UTC) Cc: 1036@debbugs.gnu.org To: Adam =?UTF-8?Q?Sj=C3=B8gren?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 04 14:47:25 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tr7cF-0007L4-3x for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Jan 2013 14:47:19 +0100 Original-Received: from localhost ([::1]:54774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr7c0-0006AP-00 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Jan 2013 08:47:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr7bw-0006AB-RO for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2013 08:47:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tr7bv-0004Pb-4o for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2013 08:47:00 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr7bv-0004PV-16 for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2013 08:46:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tr7c0-0008FA-Bx for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2013 08:47:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Jan D." Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Jan 2013 13:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1036 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 1036-submit@debbugs.gnu.org id=B1036.135730719431645 (code B ref 1036); Fri, 04 Jan 2013 13:47:03 +0000 Original-Received: (at 1036) by debbugs.gnu.org; 4 Jan 2013 13:46:34 +0000 Original-Received: from localhost ([127.0.0.1]:42849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tr7bT-0008EJ-B1 for submit@debbugs.gnu.org; Fri, 04 Jan 2013 08:46:32 -0500 Original-Received: from mailout.melmac.se ([62.20.26.67]:48836) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tr7bM-0008E6-K9 for 1036@debbugs.gnu.org; Fri, 04 Jan 2013 08:46:26 -0500 Original-Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 3021495A6 for <1036@debbugs.gnu.org>; Fri, 4 Jan 2013 14:46:16 +0100 (CET) Original-Received: (qmail 4682 invoked by uid 89); 4 Jan 2013 13:46:16 -0000 Original-Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 4 Jan 2013 13:46:16 -0000 Original-Received: from [172.20.199.2] (gaffa [172.20.199.2]) by coolsville.localdomain (Postfix) with ESMTPSA id 9700D7FA05E; Fri, 4 Jan 2013 14:46:15 +0100 (CET) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <87r4m7uh4e.fsf@topper.koldfront.dk> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69383 Archived-At: Hello. Before installing this, can someone confirm that this is a tiny change? Jan D. Adam Sj=F8gren skrev 2012-12-31 02:48: > On Mon, 03 Dec 2012 12:22:11 -0500, Stefan wrote: > >>> If we are to provide a user option for this, we should do it for all >>> toolkits. >> Yes, we should do that (and share more of the code, as well). > Here is a new patch that handles both toolskits that use the "* 30" > method. > > Let me know what else I can do to move this forward. > > > Thanks! > > Adam > > > --- > src/ChangeLog | 9 +++++++++ > src/gtkutil.c | 18 +++++++++++------- > src/xterm.c | 41 ++++++++++++++++++++++++++--------------- > 3 files changed, 46 insertions(+), 22 deletions(-) > > diff --git a/src/ChangeLog b/src/ChangeLog > index 08b0a59..d653cb5 100644 > --- a/src/ChangeLog > +++ b/src/ChangeLog > @@ -1,3 +1,12 @@ > +2012-12-31 Adam Sj=F8gren > + > + * xterm.c (scroll-bar-adjust-thumb-portion): New variable to > + determine whether scroll bar thumb size should be adjusted or > + not. Use variable for MOTIF. > + > + * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for > + GTK. > + > 2012-12-30 Paul Eggert > =20 > * coding.c (Qmac): Now static. > diff --git a/src/gtkutil.c b/src/gtkutil.c > index 7b05cff..ba532c2 100644 > --- a/src/gtkutil.c > +++ b/src/gtkutil.c > @@ -3795,13 +3795,17 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_= bar *bar, > =20 > adj =3D gtk_range_get_adjustment (GTK_RANGE (wscroll)); > =20 > - /* We do the same as for MOTIF in xterm.c, assume 30 chars per l= ine > - rather than the real portion value. This makes the thumb les= s likely > - to resize and that looks better. */ > - portion =3D WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; > - /* When the thumb is at the bottom, position =3D=3D whole. > - So we need to increase `whole' to make space for the thumb. = */ > - whole +=3D portion; > + if (scroll_bar_adjust_thumb_portion_p) > + { > + /* We do the same as for MOTIF in xterm.c, use 30 chars per > + line rather than the real portion value. This makes the > + thumb less likely to resize and that looks better. */ > + portion =3D WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; > + > + /* When the thumb is at the bottom, position =3D=3D whole. > + So we need to increase `whole' to make space for the thum= b. */ > + whole +=3D portion; > + } > =20 > if (whole <=3D 0) > top =3D 0, shown =3D 1; > diff --git a/src/xterm.c b/src/xterm.c > index 374b628..446565a 100644 > --- a/src/xterm.c > +++ b/src/xterm.c > @@ -4803,21 +4803,24 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_b= ar *bar, int portion, int positio > =20 > #ifdef USE_MOTIF > =20 > - /* We use an estimate of 30 chars per line rather than the real > - `portion' value. This has the disadvantage that the thumb size > - is not very representative, but it makes our life a lot easier. > - Otherwise, we have to constantly adjust the thumb size, which > - we can't always do quickly enough: while dragging, the size of > - the thumb might prevent the user from dragging the thumb all the > - way to the end. but Motif and some versions of Xaw3d don't allow > - updating the thumb size while dragging. Also, even if we can upd= ate > - its size, the update will often happen too late. > - If you don't believe it, check out revision 1.650 of xterm.c to s= ee > - what hoops we were going through and the still poor behavior we g= ot. */ > - portion =3D WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; > - /* When the thumb is at the bottom, position =3D=3D whole. > - So we need to increase `whole' to make space for the thumb. */ > - whole +=3D portion; > + if (scroll_bar_adjust_thumb_portion_p) > + { > + /* We use an estimate of 30 chars per line rather than the real > + `portion' value. This has the disadvantage that the thumb si= ze > + is not very representative, but it makes our life a lot easie= r. > + Otherwise, we have to constantly adjust the thumb size, which > + we can't always do quickly enough: while dragging, the size o= f > + the thumb might prevent the user from dragging the thumb all = the > + way to the end. but Motif and some versions of Xaw3d don't a= llow > + updating the thumb size while dragging. Also, even if we can= update > + its size, the update will often happen too late. > + If you don't believe it, check out revision 1.650 of xterm.c = to see > + what hoops we were going through and the still poor behavior = we got. */ > + portion =3D WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; > + /* When the thumb is at the bottom, position =3D=3D whole. > + So we need to increase `whole' to make space for the thumb. = */ > + whole +=3D portion; > + } > =20 > if (whole <=3D 0) > top =3D 0, shown =3D 1; > @@ -10785,6 +10788,14 @@ With MS Windows or Nextstep, the value is t. = */); > Vx_toolkit_scroll_bars =3D Qnil; > #endif > =20 > + DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion", > + scroll_bar_adjust_thumb_portion_p, > + doc: /* Non-nil means adjust the thumb in the > +scroll bar to be less likely to resize which looks better. > +Set to nil if you want the thumb to fill the whole scroll bar > +when the entire buffer is visible. */); > + scroll_bar_adjust_thumb_portion_p =3D 1; > + > staticpro (&last_mouse_motion_frame); > last_mouse_motion_frame =3D Qnil; > =20