From: Richard M. Stallman Date: Fri, 4 Jul 1997 04:48:13 +0000 (+0000) Subject: (x_set_scroll_bar_width): By default, use enough X-Git-Tag: emacs-20.1~1352 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a672c74d731d96d777d261c16be6f280cf1376d9;p=emacs.git (x_set_scroll_bar_width): By default, use enough columns to give 14 or more pixels. --- diff --git a/src/xfns.c b/src/xfns.c index fa837e6a4c0..070fe10615f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1986,18 +1986,23 @@ x_set_scroll_bar_width (f, arg, oldval) struct frame *f; Lisp_Object arg, oldval; { + int wid = FONT_WIDTH (f->output_data.x->font); + if (NILP (arg)) { + /* Make the actual width at least 14 pixels + and a multiple of a character width. */ + FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; + /* Use all of that space (aside from required margins) + for the scroll bar. */ FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0; - FRAME_SCROLL_BAR_COLS (f) = 3; + if (FRAME_X_WINDOW (f)) x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); } else if (INTEGERP (arg) && XINT (arg) > 0 && XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f)) { - int wid = FONT_WIDTH (f->output_data.x->font); - if (XFASTINT (arg) <= 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM) XSETINT (arg, 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM + 1);