struct x_display_info *dpyinfo;
struct x_output *output;
#endif
+ bool output_flushed;
if (FRAME_PARENT_FRAME (f))
{
}
}
- XFlush (FRAME_X_DISPLAY (f));
-
/* Synchronize to ensure Emacs knows the frame is visible
before we do anything else. We do this loop with input not blocked
so that incoming events are handled. */
/* This must come after we set COUNT. */
unblock_input ();
+ /* Keep track of whether or not the output buffer was flushed, to
+ avoid any extra flushes. */
+ output_flushed = false;
+
/* We unblock here so that arriving X events are processed. */
/* Now move the window back to where it was "supposed to be".
there, and take the potential window manager hit. */
XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
&rootw, &x, &y, &width, &height, &border, &depth);
+ output_flushed = true;
if (original_left != x || original_top != y)
XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
(f, build_string ("x_make_frame_visible"));
x_wait_for_event (f, MapNotify);
+ output_flushed = true;
}
+
+ if (!output_flushed)
+ x_flush (f);
}
}