From ae17ab84f9e511166b764b278cceba9f21aaef14 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 26 Oct 2001 12:00:28 +0000 Subject: [PATCH] (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: Fix clearing in the case of scroll bars on the right. --- src/ChangeLog | 3 +++ src/xterm.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 461978de98a..8628e831f83 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2001-10-26 Gerd Moellmann + * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: + Fix clearing in the case of scroll bars on the right. + * xfns.c (XScreenNumberOfScreen): Fix struct to pointer comparison. diff --git a/src/xterm.c b/src/xterm.c index d6d1f827dd5..d18f671a108 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9239,10 +9239,16 @@ XTset_vertical_scroll_bar (w, portion, whole, position) { int area_width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f); int rest = area_width - sb_width; - if (rest > 0) - x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - left + area_width - rest, top, - rest, max (height, 1), False); + if (rest > 0 && height > 0) + { + if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) + x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + left + area_width - rest, top, + rest, height, False); + else + x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + left, top, rest, height, False); + } } /* Move/size the scroll bar window. */ -- 2.39.2