]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid potentially expensive XFlush and fix ordering
authorPo Lu <luangruo@yahoo.com>
Tue, 22 Nov 2022 11:43:14 +0000 (19:43 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 22 Nov 2022 12:04:47 +0000 (20:04 +0800)
* src/xterm.c (x_raise_frame): Don't call XFlush without a
request being made.
(x_lower_frame): Fix ordering wrt to xwidget view lowering.

src/xterm.c

index af652a0d856f7cf97c9d2051b0f8bbfd6ad4c364..154f404e6b4e68ed648ad008c766350950c2c63c 100644 (file)
@@ -27517,9 +27517,14 @@ static void
 x_raise_frame (struct frame *f)
 {
   block_input ();
+
   if (FRAME_VISIBLE_P (f))
-    XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
-  XFlush (FRAME_X_DISPLAY (f));
+    {
+      XRaiseWindow (FRAME_X_DISPLAY (f),
+                   FRAME_OUTER_WINDOW (f));
+      XFlush (FRAME_X_DISPLAY (f));
+    }
+
   unblock_input ();
 }
 
@@ -27567,8 +27572,6 @@ x_lower_frame (struct frame *f)
     XLowerWindow (FRAME_X_DISPLAY (f),
                  FRAME_OUTER_WINDOW (f));
 
-  XFlush (FRAME_X_DISPLAY (f));
-
 #ifdef HAVE_XWIDGETS
   /* Make sure any X windows owned by xwidget views of the parent
      still display below the lowered frame.  */
@@ -27576,6 +27579,8 @@ x_lower_frame (struct frame *f)
   if (FRAME_PARENT_FRAME (f))
     lower_frame_xwidget_views (FRAME_PARENT_FRAME (f));
 #endif
+
+  XFlush (FRAME_X_DISPLAY (f));
 }
 
 static void