unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1036: 23.0.60; GTK+ scroll-bars don't show relation of viewport to whole buffer
@ 2008-09-26 21:05 Peter Dyballa
  2008-09-28  1:17 ` Stefan Monnier
  2012-12-02 13:07 ` bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable Adam Sjøgren
  0 siblings, 2 replies; 11+ messages in thread
From: Peter Dyballa @ 2008-09-26 21:05 UTC (permalink / raw)
  To: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

Hello!

I am using usually the Xaw3d toolkit, now I compiled a "default"  
Emacs. Just choose "Send Bug Report…" from the Help menu and you can  
see that GTK is lying. The *Bug Help* buffer has six or seven lines  
of text and its size is 20 or 30 lines. And was does the scroll-bar  
show? The slider occupies two thirds of the scroll-bar area – are  
there some invisible ten or 15 more lines anywhere? In the Xaw3d  
version the slider occupies the whole scroll-bar. *That's* correct.

Look at this example! In *shell* buffer seven out of 24 lines are  
used up. The slider in the scroll-bar obviously does not represent  
anything. In the Xaw3d version the slider takes the whole scroll-bar  
because there is not yet any hidden text.
In the lower buffer the file Kanäle is partially shown. The red block  
cursor stands on line #7 of 62 lines – why is the whole scroll-bar  
filled with the slider? In Xaw3d I have a small slider in a few times  
larger scroll-bar.

[-- Attachment #2: GTK Emacs windowmaker.jpg --]
[-- Type: image/jpeg, Size: 31435 bytes --]

[-- Attachment #3: Type: text/plain, Size: 2094 bytes --]




In GNU Emacs 23.0.60.1 (powerpc-apple-darwin8.11.0, GTK+ Version  
2.12.11)
  of 2008-09-26 on localhost
Windowing system distributor `The XFree86 Project, Inc', version  
11.0.40400000
configured using `configure  '--without-sound' '--without-pop' '-- 
with-dbus' '--with-libotf' '--enable-locallisppath=/Library/ 
Application Support/Emacs/calendar23:/Library/Application Support/ 
Emacs/caml:/Library/Application Support/Emacs:/sw/share/emacs21/site- 
lisp/elib' 'PKG_CONFIG_PATH=/sw/lib/xft2/lib/pkgconfig:/sw/lib/ 
fontconfig2/lib/pkgconfig:/sw/lib/freetype219/lib/pkgconfig:/sw/lib/ 
pango-ft219/lib/pkgconfig:/sw/lib/qt4-x11/lib/pkgconfig:/sw/lib/ 
system-openssl/lib/pkgconfig:/sw/lib/pkgconfig:/sw/share/pkgconfig:/ 
usr/X11R6/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'  
'CFLAGS=-Wno-pointer-sign -bind_at_load -H -pipe -fPIC -mcpu=7450 - 
mtune=7450 -fast -mpim-altivec -ftree-vectorize -foptimize-register- 
move -freorder-blocks -freorder-blocks-and-partition -fthread-jumps - 
fpeephole -fno-crossjumping' 'CPPFLAGS=-no-cpp-precomp' 'LDFLAGS=- 
bind_at_load -dead_strip -multiply_defined suppress -L/sw/lib/ncurses''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: de_DE.UTF-8
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: de_DE.UTF-8
   value of $XMODIFIERS: nil
   locale-coding-system: utf-8-unix
   default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
   show-paren-mode: t
   display-time-mode: t
   tooltip-mode: t
   tool-bar-mode: t
   mouse-wheel-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t

--
Greetings

   Pete

Klingon function calls do not have "parameters" - they have  
"arguments"- and they ALWAYS WIN THEM.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: 23.0.60; GTK+ scroll-bars don't show relation of viewport to whole buffer
  2008-09-26 21:05 bug#1036: 23.0.60; GTK+ scroll-bars don't show relation of viewport to whole buffer Peter Dyballa
@ 2008-09-28  1:17 ` Stefan Monnier
  2012-12-02 13:07 ` bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable Adam Sjøgren
  1 sibling, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2008-09-28  1:17 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: 1036

severity 1036 wishitem
thanks

> 20 or 30 lines. And was does the scroll-bar  show? The slider occupies two
> thirds of the scroll-bar area – are  there some invisible ten or 15 more
> lines anywhere? In the Xaw3d  version the slider occupies the whole
> scroll-bar. *That's* correct.

Known problem.  The only known solution involves fixing Gtk's code,
which requires first fixing Gtk developer's mindset.


        Stefan






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable.
  2008-09-26 21:05 bug#1036: 23.0.60; GTK+ scroll-bars don't show relation of viewport to whole buffer Peter Dyballa
  2008-09-28  1:17 ` Stefan Monnier
@ 2012-12-02 13:07 ` Adam Sjøgren
  2012-12-02 20:51   ` Jan Djärv
  1 sibling, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2012-12-02 13:07 UTC (permalink / raw)
  To: 1036

Seeing that there is no correct solution in sight, maybe it would be
possible to solve the problem like this.

Summary of problem and links to discussions in the previous decade, see
here: http://koldfront.dk/archive/2012/05/27-181826.html

---
 src/ChangeLog |    7 +++++++
 src/gtkutil.c |   18 +++++++++++-------
 src/xterm.c   |   10 ++++++++++
 3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 80b9b1e..b95cf17 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-02  Adam Sjøgren  <asjo@koldfront.dk>
+
+	* xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to
+	determine whether gtk scroll bar thumb size should be adjusted or
+	not (Bug#1036).
+	* gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable.
+
 2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4367b53..5259fe7 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3765,13 +3765,17 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
 
       adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
 
-      /* We do the same as for MOTIF in xterm.c, assume 30 chars per line
-         rather than the real portion value.  This makes the thumb less likely
-         to resize and that looks better.  */
-      portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
-      /* When the thumb is at the bottom, position == whole.
-         So we need to increase `whole' to make space for the thumb.  */
-      whole += portion;
+      if (gtk_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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
+
+          /* When the thumb is at the bottom, position == whole.
+             So we need to increase `whole' to make space for the thumb.  */
+          whole += portion;
+        }
 
       if (whole <= 0)
         top = 0, shown = 1;
diff --git a/src/xterm.c b/src/xterm.c
index bbcff8c..64f069d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10791,6 +10791,16 @@ With MS Windows or Nextstep, the value is t.  */);
   Vx_toolkit_scroll_bars = Qnil;
 #endif
 
+#ifdef USE_GTK
+  DEFVAR_BOOL ("gtk-scroll-bar-adjust-thumb-portion",
+              gtk_scroll_bar_adjust_thumb_portion_p,
+              doc: /* Non-nil means adjust the thumb in the
+gtk 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.  */);
+  gtk_scroll_bar_adjust_thumb_portion_p = 1;
+#endif
+
   staticpro (&last_mouse_motion_frame);
   last_mouse_motion_frame = Qnil;
 
-- 
1.7.10.4

-- 
 "It's beautiful! And I certainly hope                        Adam Sjøgren
  my parents hate this album!"                           asjo@koldfront.dk





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable.
  2012-12-02 13:07 ` bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable Adam Sjøgren
@ 2012-12-02 20:51   ` Jan Djärv
  2012-12-03 17:22     ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Djärv @ 2012-12-02 20:51 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: 1036

Hello.

If we are to provide a user option for this, we should do it for all toolkits.
Anyway, the code to do this has always been trivial, its more a policy thing.

	Jan D.
 
2 dec 2012 kl. 14:07 skrev asjo@koldfront.dk (Adam Sjøgren):

> Seeing that there is no correct solution in sight, maybe it would be
> possible to solve the problem like this.
> 
> Summary of problem and links to discussions in the previous decade, see
> here: http://koldfront.dk/archive/2012/05/27-181826.html
> 
> ---
> src/ChangeLog |    7 +++++++
> src/gtkutil.c |   18 +++++++++++-------
> src/xterm.c   |   10 ++++++++++
> 3 files changed, 28 insertions(+), 7 deletions(-)
> 
> diff --git a/src/ChangeLog b/src/ChangeLog
> index 80b9b1e..b95cf17 100644
> --- a/src/ChangeLog
> +++ b/src/ChangeLog
> @@ -1,3 +1,10 @@
> +2012-12-02  Adam Sjøgren  <asjo@koldfront.dk>
> +
> +	* xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to
> +	determine whether gtk scroll bar thumb size should be adjusted or
> +	not (Bug#1036).
> +	* gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable.
> +
> 2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>
> 
> 	* xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
> diff --git a/src/gtkutil.c b/src/gtkutil.c
> index 4367b53..5259fe7 100644
> --- a/src/gtkutil.c
> +++ b/src/gtkutil.c
> @@ -3765,13 +3765,17 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
> 
>       adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
> 
> -      /* We do the same as for MOTIF in xterm.c, assume 30 chars per line
> -         rather than the real portion value.  This makes the thumb less likely
> -         to resize and that looks better.  */
> -      portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
> -      /* When the thumb is at the bottom, position == whole.
> -         So we need to increase `whole' to make space for the thumb.  */
> -      whole += portion;
> +      if (gtk_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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
> +
> +          /* When the thumb is at the bottom, position == whole.
> +             So we need to increase `whole' to make space for the thumb.  */
> +          whole += portion;
> +        }
> 
>       if (whole <= 0)
>         top = 0, shown = 1;
> diff --git a/src/xterm.c b/src/xterm.c
> index bbcff8c..64f069d 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -10791,6 +10791,16 @@ With MS Windows or Nextstep, the value is t.  */);
>   Vx_toolkit_scroll_bars = Qnil;
> #endif
> 
> +#ifdef USE_GTK
> +  DEFVAR_BOOL ("gtk-scroll-bar-adjust-thumb-portion",
> +              gtk_scroll_bar_adjust_thumb_portion_p,
> +              doc: /* Non-nil means adjust the thumb in the
> +gtk 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.  */);
> +  gtk_scroll_bar_adjust_thumb_portion_p = 1;
> +#endif
> +
>   staticpro (&last_mouse_motion_frame);
>   last_mouse_motion_frame = Qnil;
> 
> -- 
> 1.7.10.4
> 
> -- 
> "It's beautiful! And I certainly hope                        Adam Sjøgren
>  my parents hate this album!"                           asjo@koldfront.dk
> 
> 






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable.
  2012-12-02 20:51   ` Jan Djärv
@ 2012-12-03 17:22     ` Stefan Monnier
  2012-12-31  1:48       ` bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2012-12-03 17:22 UTC (permalink / raw)
  To: Jan Djärv; +Cc: Adam Sjøgren, 1036

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


        Stefan





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion.
  2012-12-03 17:22     ` Stefan Monnier
@ 2012-12-31  1:48       ` Adam Sjøgren
  2013-01-04 13:46         ` Jan D.
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2012-12-31  1:48 UTC (permalink / raw)
  To: 1036

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øgren  <asjo@koldfront.dk>
+
+	* 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  <eggert@cs.ucla.edu>
 
 	* 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,
 
       adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
 
-      /* We do the same as for MOTIF in xterm.c, assume 30 chars per line
-         rather than the real portion value.  This makes the thumb less likely
-         to resize and that looks better.  */
-      portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
-      /* When the thumb is at the bottom, position == whole.
-         So we need to increase `whole' to make space for the thumb.  */
-      whole += 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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
+
+          /* When the thumb is at the bottom, position == whole.
+             So we need to increase `whole' to make space for the thumb.  */
+          whole += portion;
+        }
 
       if (whole <= 0)
         top = 0, shown = 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_bar *bar, int portion, int positio
 
 #ifdef USE_MOTIF
 
-  /* 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 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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
-  /* When the thumb is at the bottom, position == whole.
-     So we need to increase `whole' to make space for the thumb.  */
-  whole += 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 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 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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
+      /* When the thumb is at the bottom, position == whole.
+         So we need to increase `whole' to make space for the thumb.  */
+      whole += portion;
+    }
 
   if (whole <= 0)
     top = 0, shown = 1;
@@ -10785,6 +10788,14 @@ With MS Windows or Nextstep, the value is t.  */);
   Vx_toolkit_scroll_bars = Qnil;
 #endif
 
+  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 = 1;
+
   staticpro (&last_mouse_motion_frame);
   last_mouse_motion_frame = Qnil;
 
-- 
1.7.10.4


-- 
 "Noone stops you                                             Adam Sjøgren
  Like you stop yourself"                                asjo@koldfront.dk





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion.
  2012-12-31  1:48       ` bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion Adam Sjøgren
@ 2013-01-04 13:46         ` Jan D.
  2013-01-04 19:15           ` Glenn Morris
  0 siblings, 1 reply; 11+ messages in thread
From: Jan D. @ 2013-01-04 13:46 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: 1036

Hello.

Before installing this, can someone confirm that this is a tiny change?

     Jan D.


Adam Sjøgren 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øgren  <asjo@koldfront.dk>
> +
> +	* 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  <eggert@cs.ucla.edu>
>   
>   	* 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,
>   
>         adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
>   
> -      /* We do the same as for MOTIF in xterm.c, assume 30 chars per line
> -         rather than the real portion value.  This makes the thumb less likely
> -         to resize and that looks better.  */
> -      portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
> -      /* When the thumb is at the bottom, position == whole.
> -         So we need to increase `whole' to make space for the thumb.  */
> -      whole += 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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
> +
> +          /* When the thumb is at the bottom, position == whole.
> +             So we need to increase `whole' to make space for the thumb.  */
> +          whole += portion;
> +        }
>   
>         if (whole <= 0)
>           top = 0, shown = 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_bar *bar, int portion, int positio
>   
>   #ifdef USE_MOTIF
>   
> -  /* 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 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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
> -  /* When the thumb is at the bottom, position == whole.
> -     So we need to increase `whole' to make space for the thumb.  */
> -  whole += 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 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 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 = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
> +      /* When the thumb is at the bottom, position == whole.
> +         So we need to increase `whole' to make space for the thumb.  */
> +      whole += portion;
> +    }
>   
>     if (whole <= 0)
>       top = 0, shown = 1;
> @@ -10785,6 +10788,14 @@ With MS Windows or Nextstep, the value is t.  */);
>     Vx_toolkit_scroll_bars = Qnil;
>   #endif
>   
> +  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 = 1;
> +
>     staticpro (&last_mouse_motion_frame);
>     last_mouse_motion_frame = Qnil;
>   






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion.
  2013-01-04 13:46         ` Jan D.
@ 2013-01-04 19:15           ` Glenn Morris
  2013-01-04 19:27             ` bug#1036: " Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Glenn Morris @ 2013-01-04 19:15 UTC (permalink / raw)
  To: Jan D.; +Cc: Adam Sjøgren, 1036

"Jan D." wrote:

> Before installing this, can someone confirm that this is a tiny change?

Looks like one to me (most of it just moves existing comments around).

Maybe a good idea to complete an assignment if Adam expects to make more
contributions after this (other than to Gnus).

>> +              doc: /* Non-nil means adjust the thumb in the
>> +scroll bar to be less likely to resize which looks better.

First line of doc does not look like a complete sentence.
(maybe lose the subjective part).





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: Add scroll-bar-adjust-thumb-portion.
  2013-01-04 19:15           ` Glenn Morris
@ 2013-01-04 19:27             ` Adam Sjøgren
  2013-01-13 15:57               ` Jan Djärv
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-01-04 19:27 UTC (permalink / raw)
  To: Glenn Morris, Jan D.; +Cc: 1036

On Fri, 04 Jan 2013 14:15:36 -0500, Glenn wrote:

> "Jan D." wrote:

>> Before installing this, can someone confirm that this is a tiny change?

> Looks like one to me (most of it just moves existing comments around).

It is two if()'s being added, and the variable they check - the rest is
indentation, yes.

> Maybe a good idea to complete an assignment if Adam expects to make more
> contributions after this (other than to Gnus).

I wrote to assign@gnu.org earlier today asking for the paperwork to be
set in motion.


  Thanks!

   Adam

-- 
 "You know, if the sun was an oboe, what would you do?"       Adam Sjøgren
                                                         asjo@koldfront.dk





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: Add scroll-bar-adjust-thumb-portion.
  2013-01-04 19:27             ` bug#1036: " Adam Sjøgren
@ 2013-01-13 15:57               ` Jan Djärv
  2013-01-13 15:58                 ` Jan Djärv
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Djärv @ 2013-01-13 15:57 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: 1036

Hello.

I have installed this.  I adjusted the documentation and made it customizable.

	Jan D.

4 jan 2013 kl. 20:27 skrev Adam Sjøgren <asjo@koldfront.dk>:

> On Fri, 04 Jan 2013 14:15:36 -0500, Glenn wrote:
> 
>> "Jan D." wrote:
> 
>>> Before installing this, can someone confirm that this is a tiny change?
> 
>> Looks like one to me (most of it just moves existing comments around).
> 
> It is two if()'s being added, and the variable they check - the rest is
> indentation, yes.
> 
>> Maybe a good idea to complete an assignment if Adam expects to make more
>> contributions after this (other than to Gnus).
> 
> I wrote to assign@gnu.org earlier today asking for the paperwork to be
> set in motion.
> 
> 
>  Thanks!
> 
>   Adam
> 
> -- 
> "You know, if the sun was an oboe, what would you do?"       Adam Sjøgren
>                                                         asjo@koldfront.dk






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#1036: Add scroll-bar-adjust-thumb-portion.
  2013-01-13 15:57               ` Jan Djärv
@ 2013-01-13 15:58                 ` Jan Djärv
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Djärv @ 2013-01-13 15:58 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: 1036-done

Closing.

	Jan D.






^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-01-13 15:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-26 21:05 bug#1036: 23.0.60; GTK+ scroll-bars don't show relation of viewport to whole buffer Peter Dyballa
2008-09-28  1:17 ` Stefan Monnier
2012-12-02 13:07 ` bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New variable to determine whether gtk scroll bar thumb size should be adjusted or not. * gtkutil.c (gtk-scroll-bar-adjust-thumb-portion): Use variable Adam Sjøgren
2012-12-02 20:51   ` Jan Djärv
2012-12-03 17:22     ` Stefan Monnier
2012-12-31  1:48       ` bug#1036: [PATCH] Add scroll-bar-adjust-thumb-portion Adam Sjøgren
2013-01-04 13:46         ` Jan D.
2013-01-04 19:15           ` Glenn Morris
2013-01-04 19:27             ` bug#1036: " Adam Sjøgren
2013-01-13 15:57               ` Jan Djärv
2013-01-13 15:58                 ` Jan Djärv

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