comparison src/xterm.c @ 40610:e2da1b3f3d94

(x_scroll_bar_create): Check for width and height > 0. (XTset_vertical_scroll_bar): Likewise.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 01 Nov 2001 11:24:41 +0000
parents a4363606beb1
children cd732a04b136
comparison
equal deleted inserted replaced
40609:3e60edf920ed 40610:e2da1b3f3d94
8954 mask = (CWBackPixel | CWEventMask | CWCursor); 8954 mask = (CWBackPixel | CWEventMask | CWCursor);
8955 8955
8956 /* Clear the area of W that will serve as a scroll bar. This is 8956 /* Clear the area of W that will serve as a scroll bar. This is
8957 for the case that a window has been split horizontally. In 8957 for the case that a window has been split horizontally. In
8958 this case, no clear_frame is generated to reduce flickering. */ 8958 this case, no clear_frame is generated to reduce flickering. */
8959 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 8959 if (width > 0 && height > 0)
8960 left, top, width, 8960 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
8961 window_box_height (w), False); 8961 left, top, width,
8962 window_box_height (w), False);
8962 8963
8963 window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 8964 window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
8964 /* Position and size of scroll bar. */ 8965 /* Position and size of scroll bar. */
8965 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 8966 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
8966 top, 8967 top,
9199 #endif 9200 #endif
9200 9201
9201 /* Does the scroll bar exist yet? */ 9202 /* Does the scroll bar exist yet? */
9202 if (NILP (w->vertical_scroll_bar)) 9203 if (NILP (w->vertical_scroll_bar))
9203 { 9204 {
9204 if (width && height) 9205 if (width > 0 && height > 0)
9205 { 9206 {
9206 BLOCK_INPUT; 9207 BLOCK_INPUT;
9207 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 9208 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
9208 left, top, width, height, False); 9209 left, top, width, height, False);
9209 UNBLOCK_INPUT; 9210 UNBLOCK_INPUT;
9231 9232
9232 #ifdef USE_TOOLKIT_SCROLL_BARS 9233 #ifdef USE_TOOLKIT_SCROLL_BARS
9233 9234
9234 /* Since toolkit scroll bars are smaller than the space reserved 9235 /* Since toolkit scroll bars are smaller than the space reserved
9235 for them on the frame, we have to clear "under" them. */ 9236 for them on the frame, we have to clear "under" them. */
9236 if (width && height) 9237 if (width > 0 && height > 0)
9237 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 9238 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
9238 left, top, width, height, False); 9239 left, top, width, height, False);
9239 9240
9240 /* Move/size the scroll bar widget. */ 9241 /* Move/size the scroll bar widget. */
9241 if (mask) 9242 if (mask)