aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorJan Djärv2013-01-11 05:57:45 +0100
committerJan Djärv2013-01-11 05:57:45 +0100
commitec782c5f13fbcebe3b02106357c7daa0681a2b08 (patch)
tree89a2c74f4d1d5d84e1591987e64a526e3b4a8f92 /src/xterm.c
parenteac4d08fb1864aa178cfa0037352f5a0a7a20597 (diff)
downloademacs-ec782c5f13fbcebe3b02106357c7daa0681a2b08.tar.gz
emacs-ec782c5f13fbcebe3b02106357c7daa0681a2b08.zip
Introduce scroll-bar-adjust-thumb-portion.
* 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.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/xterm.c b/src/xterm.c
index f63f10566f6..cbae1bc4b0d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4802,21 +4802,24 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
4802 4802
4803#ifdef USE_MOTIF 4803#ifdef USE_MOTIF
4804 4804
4805 /* We use an estimate of 30 chars per line rather than the real 4805 if (scroll_bar_adjust_thumb_portion_p)
4806 `portion' value. This has the disadvantage that the thumb size 4806 {
4807 is not very representative, but it makes our life a lot easier. 4807 /* We use an estimate of 30 chars per line rather than the real
4808 Otherwise, we have to constantly adjust the thumb size, which 4808 `portion' value. This has the disadvantage that the thumb size
4809 we can't always do quickly enough: while dragging, the size of 4809 is not very representative, but it makes our life a lot easier.
4810 the thumb might prevent the user from dragging the thumb all the 4810 Otherwise, we have to constantly adjust the thumb size, which
4811 way to the end. but Motif and some versions of Xaw3d don't allow 4811 we can't always do quickly enough: while dragging, the size of
4812 updating the thumb size while dragging. Also, even if we can update 4812 the thumb might prevent the user from dragging the thumb all the
4813 its size, the update will often happen too late. 4813 way to the end. but Motif and some versions of Xaw3d don't allow
4814 If you don't believe it, check out revision 1.650 of xterm.c to see 4814 updating the thumb size while dragging. Also, even if we can update
4815 what hoops we were going through and the still poor behavior we got. */ 4815 its size, the update will often happen too late.
4816 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; 4816 If you don't believe it, check out revision 1.650 of xterm.c to see
4817 /* When the thumb is at the bottom, position == whole. 4817 what hoops we were going through and the still poor behavior we got. */
4818 So we need to increase `whole' to make space for the thumb. */ 4818 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
4819 whole += portion; 4819 /* When the thumb is at the bottom, position == whole.
4820 So we need to increase `whole' to make space for the thumb. */
4821 whole += portion;
4822 }
4820 4823
4821 if (whole <= 0) 4824 if (whole <= 0)
4822 top = 0, shown = 1; 4825 top = 0, shown = 1;
@@ -10784,6 +10787,14 @@ With MS Windows or Nextstep, the value is t. */);
10784 Vx_toolkit_scroll_bars = Qnil; 10787 Vx_toolkit_scroll_bars = Qnil;
10785#endif 10788#endif
10786 10789
10790 DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion",
10791 scroll_bar_adjust_thumb_portion_p,
10792 doc: /* Non-nil means adjust the thumb in the
10793scroll bar to be less likely to resize which looks better.
10794Set to nil if you want the thumb to fill the whole scroll bar
10795when the entire buffer is visible. */);
10796 scroll_bar_adjust_thumb_portion_p = 1;
10797
10787 staticpro (&last_mouse_motion_frame); 10798 staticpro (&last_mouse_motion_frame);
10788 last_mouse_motion_frame = Qnil; 10799 last_mouse_motion_frame = Qnil;
10789 10800