From 7fff3c9b7e44b5ce6e7a13d257613aeeb530fad1 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 21 Jan 2022 13:22:51 +0800 Subject: [PATCH] Work around GTK changing window backgrounds on colormapped displays * 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index a53f2982c6b..1cbea12b3db 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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 } -- 2.39.5