]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around GTK changing window backgrounds on colormapped displays
authorPo Lu <luangruo@yahoo.com>
Fri, 21 Jan 2022 05:22:51 +0000 (13:22 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 21 Jan 2022 05:22:51 +0000 (13:22 +0800)
* src/xterm.c (x_clear_window):
(x_clear_area): Fill the contents with the reverse GC instead of
using XClearArea and XClearWindow when not double buffered.

src/xterm.c

index a53f2982c6b96c66e0f753c058be103e28a144c9..1cbea12b3db824677d2bae243d3fb89a75b393f0 100644 (file)
@@ -1283,11 +1283,15 @@ x_clear_window (struct frame *f)
   cairo_paint (cr);
   x_end_cr_clip (f);
 #else
+#ifndef USE_GTK
   if (FRAME_X_DOUBLE_BUFFERED_P (f))
+#endif
     x_clear_area (f, 0, 0, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+#ifndef USE_GTK
   else
     XClearWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
 #endif
+#endif
 }
 
 #ifdef USE_CAIRO
@@ -4499,15 +4503,19 @@ x_clear_area (struct frame *f, int x, int y, int width, int height)
   cairo_fill (cr);
   x_end_cr_clip (f);
 #else
+#ifndef USE_GTK
   if (FRAME_X_DOUBLE_BUFFERED_P (f))
+#endif
     XFillRectangle (FRAME_X_DISPLAY (f),
                    FRAME_X_DRAWABLE (f),
                    f->output_data.x->reverse_gc,
                    x, y, width, height);
+#ifndef USE_GTK
   else
     x_clear_area1 (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                    x, y, width, height, False);
 #endif
+#endif
 }