From: Po Lu Date: Sun, 6 Mar 2022 13:04:34 +0000 (+0800) Subject: Respect inhibit-double-buffering on non-toolkit scroll bars X-Git-Tag: emacs-29.0.90~1994 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ea5a0142ced33884a370e9a47f8035f303382ba7;p=emacs.git Respect inhibit-double-buffering on non-toolkit scroll bars * src/xfns.c (x_set_inhibit_double_buffering): Force scroll bars to be re-created on builds without toolkit scroll bars. * src/xterm.c (x_scroll_bar_create): Don't initialize back buffer if double buffering is disabled for the frame. --- diff --git a/src/xfns.c b/src/xfns.c index 65218b3fc07..e288f797fbd 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -818,7 +818,19 @@ x_set_inhibit_double_buffering (struct frame *f, and after any potential change. One of the calls will end up being a no-op. */ if (want_double_buffering != was_double_buffered) - font_drop_xrender_surfaces (f); + { + font_drop_xrender_surfaces (f); + + /* Scroll bars decide whether or not to use a back buffer + based on the value of this frame parameter, so destroy + all scroll bars. */ +#ifndef USE_TOOLKIT_SCROLL_BARS + if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) + FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f); + if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) + FRAME_TERMINAL (f)->judge_scroll_bars_hook (f); +#endif + } if (FRAME_X_DOUBLE_BUFFERED_P (f) && !want_double_buffering) tear_down_x_back_buffer (f); else if (!FRAME_X_DOUBLE_BUFFERED_P (f) && want_double_buffering) diff --git a/src/xterm.c b/src/xterm.c index 1d68d4e9393..8642345549c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8583,7 +8583,8 @@ x_scroll_bar_create (struct window *w, int top, int left, /* Attributes. */ mask, &a); #ifdef HAVE_XDBE - if (FRAME_DISPLAY_INFO (f)->supports_xdbe) + if (FRAME_DISPLAY_INFO (f)->supports_xdbe + && FRAME_X_DOUBLE_BUFFERED_P (f)) { x_catch_errors (FRAME_X_DISPLAY (f)); drawable = XdbeAllocateBackBufferName (FRAME_X_DISPLAY (f),