From 3e5baffd033c0e7cb738d0762a66302f2d7d2214 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 7 Mar 2022 10:54:48 +0800 Subject: [PATCH] Fix clearing of scroll bars on builds with disabled double buffers * src/xterm.c (x_scroll_bar_clear): Use XClearArea if the scroll bar is not double-buffered. --- src/xterm.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index d368c723239..0432bd78c6e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9635,15 +9635,19 @@ x_scroll_bar_clear (struct frame *f) for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); bar = XSCROLL_BAR (bar)->next) { -#ifndef HAVE_XDBE - XClearArea (FRAME_X_DISPLAY (f), - XSCROLL_BAR (bar)->x_window, - 0, 0, 0, 0, True); -#else - XFillRectangle (FRAME_X_DISPLAY (f), - XSCROLL_BAR (bar)->x_drawable, - gc, 0, 0, XSCROLL_BAR (bar)->width, - XSCROLL_BAR (bar)->height); +#ifdef HAVE_XDBE + if (XSCROLL_BAR (bar)->x_window + == XSCROLL_BAR (bar)->x_drawable) +#endif + XClearArea (FRAME_X_DISPLAY (f), + XSCROLL_BAR (bar)->x_window, + 0, 0, 0, 0, True); +#ifdef HAVE_XDBE + else + XFillRectangle (FRAME_X_DISPLAY (f), + XSCROLL_BAR (bar)->x_drawable, + gc, 0, 0, XSCROLL_BAR (bar)->width, + XSCROLL_BAR (bar)->height); #endif } -- 2.39.2