changeset 36880:f9243c6624b0

(XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]: Clear area of the frame not occupied by the scroll bar.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 19 Mar 2001 18:50:18 +0000
parents 771a25fb56df
children 61f79d7bd19f
files src/xterm.c
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Mar 19 17:34:12 2001 +0000
+++ b/src/xterm.c	Mon Mar 19 18:50:18 2001 +0000
@@ -8729,7 +8729,6 @@
 
     /* Draw the handle itself.  */
     XFillRectangle (FRAME_X_DISPLAY (f), w, gc,
-
 		    /* x, y, width, height */
 		    VERTICAL_SCROLL_BAR_LEFT_BORDER,
 		    VERTICAL_SCROLL_BAR_TOP_BORDER + start,
@@ -8875,12 +8874,10 @@
 
 #else /* not USE_TOOLKIT_SCROLL_BARS */
   
+      /* Clear areas not covered by the scroll bar because of
+	 VERTICAL_SCROLL_BAR_WIDTH_TRIM.  */
       if (VERTICAL_SCROLL_BAR_WIDTH_TRIM)
 	{
-	  /* Clear areas not covered by the scroll bar.  This makes sure a
-	     previous mode line display is cleared after C-x 2 C-x 1, for
-	     example.  Non-toolkit scroll bars are as wide as the area
-	     reserved for scroll bars - trim at both sides.  */
 	  x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
 			left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM,
 			height, False);
@@ -8889,6 +8886,19 @@
 			top, VERTICAL_SCROLL_BAR_WIDTH_TRIM,
 			height, False);
 	}
+
+      /* Clear areas not covered by the scroll bar because it's not as
+	 wide as the area reserved for it .  This makes sure a
+	 previous mode line display is cleared after C-x 2 C-x 1, for
+	 example.  */
+      {
+	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, 0,
+			rest, max (height, 1), False);
+      }
       
       /* Move/size the scroll bar window.  */
       if (mask)