]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix clearing of scroll bars on builds with disabled double buffers
authorPo Lu <luangruo@yahoo.com>
Mon, 7 Mar 2022 02:54:48 +0000 (10:54 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 7 Mar 2022 02:55:50 +0000 (10:55 +0800)
* src/xterm.c (x_scroll_bar_clear): Use XClearArea if the scroll
bar is not double-buffered.

src/xterm.c

index d368c7232394b8ddd54b5237b11f109f38b48cf2..0432bd78c6ea1ebabc2789c892c0185a71c25979 100644 (file)
@@ -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
       }