]> git.eshelyaron.com Git - emacs.git/commitdiff
Respect inhibit-double-buffering on non-toolkit scroll bars
authorPo Lu <luangruo@yahoo.com>
Sun, 6 Mar 2022 13:04:34 +0000 (21:04 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 6 Mar 2022 13:04:34 +0000 (21:04 +0800)
* 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.

src/xfns.c
src/xterm.c

index 65218b3fc0738fa779fb37865ad9da982b5681d1..e288f797fbd5c71d84ad2a2c98c88526e62b420f 100644 (file)
@@ -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)
index 1d68d4e93937537ef2135f4ed287761a934a16a9..8642345549cbd94eef2c15d1371ed9769e817fbf 100644 (file)
@@ -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),