]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow disabling frame resize synchronization
authorPo Lu <luangruo@yahoo.com>
Sun, 6 Feb 2022 02:43:38 +0000 (10:43 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 6 Feb 2022 02:43:38 +0000 (10:43 +0800)
* doc/emacs/xresources.texi (Table of Resources): Document new
parameter `synchronizeResize'.
* etc/NEWS: Announce frame resize synchronization.
* src/xterm.c (x_term_init): Don't enable XSync if the
X resource `synchronizeResize' is off or false.

doc/emacs/xresources.texi
etc/NEWS
src/xterm.c

index bb362ca3eaec40a495263e8c881eb9f472fb3aef..5e01c955d1643cc7b47d62530cd065f1330335b9 100644 (file)
@@ -373,6 +373,14 @@ Use some location on display specific to the input method for
 displaying the preview text.
 @end table
 
+@item @code{synchronizeResize} (class @code{SynchronizeResize})
+If @samp{off} or @samp{false}, Emacs will not try to tell the window
+manager when it has finished redrawing the display in response to a
+request to resize a frame.  Otherwise, the window manager will
+postpone drawing a frame that was just resized until its contents are
+updated, which prevents blank areas of a frame that have not yet been
+painted from being displayed.
+
 @item @code{verticalScrollBars} (class @code{ScrollBars})
 Give frames scroll bars on the left if @samp{left}, on the right if
 @samp{right}; don't have scroll bars if @samp{off} (@pxref{Scroll Bars}).
index b432da5d48d6b324a52c481c0953236c7a8c3aa9..6c5aeacb7bee57956688816e40526e58f5522af1 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -182,6 +182,14 @@ and pop-up menus.
 This controls the style of the pre-edit and status areas of X input
 methods.
 
++++
+** On X11, 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 responive to input, you can turn it off by setting the X
+resource "synchronizeResize" to "off".
+
 +++
 ** New frame parameter 'alpha-background' and X resource "alphaBackground".
 This controls the opacity of the text background when running on a
index 0d0a08d078b40373837738074355458d87b367f1..67b9f5b38c86f1c8a77eaaf1baecaaace791c206 100644 (file)
@@ -15681,8 +15681,22 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
     dpyinfo->xsync_supported_p = XSyncInitialize (dpyinfo->display,
                                                  &dpyinfo->xsync_major,
                                                  &dpyinfo->xsync_minor);
-#endif
 
+  {
+    AUTO_STRING (synchronizeResize, "synchronizeResize");
+    AUTO_STRING (SynchronizeResize, "SynchronizeResize");
+
+    Lisp_Object value = gui_display_get_resource (dpyinfo,
+                                                 synchronizeResize,
+                                                 SynchronizeResize,
+                                                 Qnil, Qnil);
+
+    if (STRINGP (value) &&
+       (!strcmp (SSDATA (value), "false")
+        || !strcmp (SSDATA (value), "off")))
+      dpyinfo->xsync_supported_p = false;
+  }
+#endif
   /* See if a private colormap is requested.  */
   if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen))
     {