]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor improvements to frame synchronization
authorPo Lu <luangruo@yahoo.com>
Sat, 17 Dec 2022 08:22:59 +0000 (16:22 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 17 Dec 2022 08:22:59 +0000 (16:22 +0800)
* src/xterm.c (x_sync_wait_for_frame_drawn_event): Update
compositor bypass property if frame synchronization is being
disabled.

src/xterm.c

index 278a8dda10b26f6119b86b2cf38ada610295c39f..44b53b229ad2864c52469a751e555b2e85adb6f7 100644 (file)
@@ -6991,6 +6991,7 @@ static void
 x_sync_wait_for_frame_drawn_event (struct frame *f)
 {
   XEvent event;
+  struct x_display_info *dpyinfo;
 
   if (!FRAME_X_WAITING_FOR_DRAW (f)
       /* The compositing manager can't draw a frame if it is
@@ -6998,6 +6999,8 @@ x_sync_wait_for_frame_drawn_event (struct frame *f)
       || !FRAME_VISIBLE_P (f))
     return;
 
+  dpyinfo = FRAME_DISPLAY_INFO (f);
+
   /* Wait for the frame drawn message to arrive.  */
   if (x_if_event (FRAME_X_DISPLAY (f), &event,
                  x_sync_is_frame_drawn_event, (XPointer) f,
@@ -7013,6 +7016,11 @@ x_sync_wait_for_frame_drawn_event (struct frame *f)
                   "been disabled\n");
          FRAME_X_OUTPUT (f)->use_vsync_p = false;
 
+         /* Remove the compositor bypass property from the outer
+            window.  */
+         XDeleteProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
+                          dpyinfo->Xatom_net_wm_bypass_compositor);
+
          /* Also change the frame parameter to reflect the new
             state.  */
          store_frame_param (f, Quse_frame_synchronization, Qnil);
@@ -7026,7 +7034,7 @@ x_sync_wait_for_frame_drawn_event (struct frame *f)
        }
     }
   else
-    x_sync_note_frame_times (FRAME_DISPLAY_INFO (f), f, &event);
+    x_sync_note_frame_times (dpyinfo, f, &event);
 
   FRAME_X_WAITING_FOR_DRAW (f) = false;
 }