]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable extended frame synchronization by default
authorPo Lu <luangruo@yahoo.com>
Sun, 6 Feb 2022 11:51:05 +0000 (19:51 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 6 Feb 2022 11:51:05 +0000 (19:51 +0800)
* doc/emacs/xresources.texi (Table of Resources): Document
new possible value of `synchronizeResize'.
* src/xfns.c (Fx_create_frame): Set synchronization protocol
according to `synchronizeResize'.

doc/emacs/xresources.texi
src/xfns.c

index 5e01c955d1643cc7b47d62530cd065f1330335b9..c7c6c072ee8dd74b628f2c607b567d3b108e7357 100644 (file)
@@ -379,7 +379,10 @@ 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.
+painted from being displayed.  If set to @samp{extended}, it will
+enable use of extended frame synchronization, which might be supported
+by some compositing window managers which don't support basic
+synchronization.
 
 @item @code{verticalScrollBars} (class @code{ScrollBars})
 Give frames scroll bars on the left if @samp{left}, on the right if
index 1ed4f03205370b232f973a693c85df00c8a3fef1..2b8a1abdfe0f6c060d32032e5d102b6b74b282df 100644 (file)
@@ -4815,15 +4815,25 @@ This function is an internal primitive--use `make-frame' instead.  */)
       XSyncValue initial_value;
       XSyncCounter counters[2];
 
+      AUTO_STRING (synchronizeResize, "synchronizeResize");
+      AUTO_STRING (SynchronizeResize, "SynchronizeResize");
+
+      Lisp_Object value = gui_display_get_resource (dpyinfo,
+                                                   synchronizeResize,
+                                                   SynchronizeResize,
+                                                   Qnil, Qnil);
+
       XSyncIntToValue (&initial_value, 0);
       counters[0]
        = FRAME_X_BASIC_COUNTER (f)
        = XSyncCreateCounter (FRAME_X_DISPLAY (f),
                              initial_value);
-      counters[1]
-       = FRAME_X_EXTENDED_COUNTER (f)
-       = XSyncCreateCounter (FRAME_X_DISPLAY (f),
-                             initial_value);
+
+      if (STRINGP (value) && !strcmp (SSDATA (value), "extended"))
+       counters[1]
+         = FRAME_X_EXTENDED_COUNTER (f)
+         = XSyncCreateCounter (FRAME_X_DISPLAY (f),
+                               initial_value);
 
       FRAME_X_OUTPUT (f)->current_extended_counter_value
        = initial_value;
@@ -4831,7 +4841,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
       XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
                       dpyinfo->Xatom_net_wm_sync_request_counter,
                       XA_CARDINAL, 32, PropModeReplace,
-                      (unsigned char *) &counters, 2);
+                      (unsigned char *) &counters,
+                      ((STRINGP (value)
+                        && !strcmp (SSDATA (value), "extended")) ? 2 : 1));
 #endif
     }
 #endif