bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#1036: [PATCH] * xterm.c (gtk-scroll-bar-adjust-thumb-portion): New v


From: Adam Sjøgren
Subject: 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.
Date: Sun, 02 Dec 2012 14:07:06 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)

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





reply via email to

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