from being displayed. If set to @samp{extended}, it will enable use
of an alternative frame synchronization protocol, which might be
supported by some compositing window managers that don't support the
-protocol Emacs uses by default.
+protocol Emacs uses by default, and causes Emacs to synchronize
+display with the monitor refresh rate when a compatible compositing
+window manager is in use.
@item @code{verticalScrollBars} (class @code{ScrollBars})
Give frames scroll bars on the left if @samp{left}, on the right if
menu item widgets.
+++
-** On X11, Emacs now tries to synchronize window resize with the window manager.
+** On X, Emacs now tries to synchronize window resize with the window manager.
This leads to less flicker and empty areas of a frame being displayed
when a frame is being resized. Unfortunately, it does not work on
some ancient buggy window managers, so if Emacs appears to freeze, but
is still responsive to input, you can turn it off by setting the X
resource "synchronizeResize" to "off".
++++
+** On X, Emacs can optionally synchronize display with the graphics hardware.
+When this is enabled by setting the X resource "synchronizeResize" to
+"extended", frame content "tearing" is drastically reduced. This is
+only supported on the Motif, Lucid, and no-toolkit builds, and
+requires an X compositing manager supporting the extended frame
+synchronization protocol (see
+https://fishsoup.net/misc/wm-spec-synchronization.html).
+
+++
** New frame parameter 'alpha-background' and X resource "alphaBackground".
This controls the opacity of the text background when running on a
if (XSyncValueLow32 (value) % 2)
return;
- /* Wait for a pending frame draw event if the last frame has not yet
- been drawn if F isn't double buffered. (In double buffered
- frames, this happens before buffer flipping). */
-
-#ifdef HAVE_XDBE
- if (!FRAME_X_DOUBLE_BUFFERED_P (f))
-#endif
- x_sync_wait_for_frame_drawn_event (f);
+ /* Wait for the last frame to be drawn before drawing this one. */
+ x_sync_wait_for_frame_drawn_event (f);
/* Since Emacs needs a non-urgent redraw, ensure that value % 4 ==
0. */
XSyncValueAdd (&FRAME_X_COUNTER_VALUE (f),
value, add, &overflow);
- if (XSyncValueLow32 (FRAME_X_COUNTER_VALUE (f)) % 4 != 1)
- emacs_abort ();
-
if (overflow)
- XSyncIntToValue (&FRAME_X_COUNTER_VALUE (f), 1);
+ XSyncIntToValue (&FRAME_X_COUNTER_VALUE (f), 3);
+
+ eassert (XSyncValueLow32 (FRAME_X_COUNTER_VALUE (f)) % 4 != 1);
XSyncSetCounter (FRAME_X_DISPLAY (f),
FRAME_X_EXTENDED_COUNTER (f),
x_update_begin (struct frame *f)
{
#if defined HAVE_XSYNC && !defined USE_GTK
- x_sync_update_begin (f);
+ /* If F is double-buffered, we can make the entire frame center
+ around XdbeSwapBuffers. */
+ if (!FRAME_X_DOUBLE_BUFFERED_P (f))
+ x_sync_update_begin (f);
#else
/* Nothing to do. */
#endif
/* Wait for drawing of the previous frame to complete before
displaying this new frame. */
x_sync_wait_for_frame_drawn_event (f);
+
+ /* Begin a new frame. */
+ x_sync_update_begin (f);
#endif
#ifdef USE_CAIRO
swap_info.swap_window = FRAME_X_WINDOW (f);
swap_info.swap_action = XdbeCopied;
XdbeSwapBuffers (FRAME_X_DISPLAY (f), &swap_info, 1);
+
+#if defined HAVE_XSYNC && !defined USE_GTK
+ /* Finish the frame here. */
+ x_sync_update_finish (f);
+#endif
}
+
FRAME_X_NEED_BUFFER_FLIP (f) = false;
unblock_input ();
block_input ();
#ifdef HAVE_XDBE
if (FRAME_X_NEED_BUFFER_FLIP (f))
- {
- show_back_buffer (f);
- x_sync_update_finish (f);
- }
+ show_back_buffer (f);
#endif
x_flush (f);
unblock_input ();
if (!buffer_flipping_blocked_p ()
&& FRAME_X_NEED_BUFFER_FLIP (f))
show_back_buffer (f);
-
-#if defined HAVE_XSYNC && !defined USE_GTK
- if (FRAME_X_DOUBLE_BUFFERED_P (f))
- x_sync_update_finish (f);
-#endif
#endif
#ifdef HAVE_XSYNC
XSyncIntsToValue (&FRAME_X_COUNTER_VALUE (f),
event->xclient.data.l[2],
event->xclient.data.l[3]);
+
FRAME_X_OUTPUT (f)->ext_sync_end_pending_p = true;
}