changeset 36475:488c4787ec0a

(XTset_vertical_scroll_bar): Don't clear a zero height or width area. (XTset_vertical_scroll_bar, x_scroll_bar_create): Don't configure a widget to zero height.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 02 Mar 2001 12:04:12 +0000
parents d860a6ae5843
children dbebcdc41417
files src/xterm.c
diffstat 1 files changed, 16 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Thu Mar 01 20:26:18 2001 +0000
+++ b/src/xterm.c	Fri Mar 02 12:04:12 2001 +0000
@@ -8420,15 +8420,15 @@
 
   /* Map the window/widget.  */
 #ifdef USE_TOOLKIT_SCROLL_BARS
- {
-   Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
-   XtConfigureWidget (scroll_bar,
-		     left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
-		     top,
-		     width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
-		     height, 0);
-   XtMapWidget (scroll_bar);
- }
+  {
+    Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
+    XtConfigureWidget (scroll_bar,
+		       left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
+		       top,
+		       width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
+		       max (height, 1), 0);
+    XtMapWidget (scroll_bar);
+    }
 #else /* not USE_TOOLKIT_SCROLL_BARS */
   XMapRaised (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar));
 #endif /* not USE_TOOLKIT_SCROLL_BARS */
@@ -8628,8 +8628,9 @@
   if (NILP (w->vertical_scroll_bar))
     {
       BLOCK_INPUT;
-      x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-		    left, top, width, height, False);
+      if (width && height)
+	x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+		      left, top, width, height, False);
       UNBLOCK_INPUT;
       bar = x_scroll_bar_create (w, top, sb_left, sb_width, height);
     }
@@ -8655,8 +8656,9 @@
 
       /* Since toolkit scroll bars are smaller than the space reserved
 	 for them on the frame, we have to clear "under" them.  */
-      x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-		    left, top, width, height, False);
+      if (width && height)
+	x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+		      left, top, width, height, False);
 
       /* Move/size the scroll bar widget.  */
       if (mask)
@@ -8664,7 +8666,7 @@
 			   sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
 			   top,
 			   sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
-			   height, 0);
+			   max (height, 1), 0);
 
 #else /* not USE_TOOLKIT_SCROLL_BARS */