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)
/* 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),