From: Dmitry Antipov Date: Thu, 1 Aug 2013 05:56:20 +0000 (+0400) Subject: * xterm.c (x_flush): Call XFlush once per each X display, not X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1688^2~52 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ca6cc28eb0aa7a7c20059e3eb1078ac3b646d79;p=emacs.git * xterm.c (x_flush): Call XFlush once per each X display, not frame. This is better because this code always unconditionally skips non-X frames in Vframe_list and issues the only XFlush if we have more than one X frame on the same X display. --- diff --git a/src/ChangeLog b/src/ChangeLog index 40a1d22887e..566cd2b5961 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,10 @@ * xterm.c (last_mouse_press_frame): Remove the leftover which is not really used any more. (handle_one_xevent, syms_of_xterm): Adjust users. + (x_flush): Call XFlush once per each X display, not frame. + This is better because this code always unconditionally skips + non-X frames in Vframe_list and issues the only XFlush if we + have more than one X frame on the same X display. 2013-07-31 Dmitry Antipov diff --git a/src/xterm.c b/src/xterm.c index 9f4261f025e..99cfb029e64 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -287,8 +287,6 @@ enum xembed_message XEMBED_ACTIVATE_ACCELERATOR = 14 }; -/* Used in x_flush. */ - static bool x_alloc_nearest_color_1 (Display *, Colormap, XColor *); static void x_set_window_size_1 (struct frame *, int, int, int); static void x_raise_frame (struct frame *); @@ -356,15 +354,18 @@ x_flush (struct frame *f) return; block_input (); - if (f == NULL) + if (f) + { + eassert (FRAME_X_P (f)); + XFlush (FRAME_X_DISPLAY (f)); + } + else { - Lisp_Object rest, frame; - FOR_EACH_FRAME (rest, frame) - if (FRAME_X_P (XFRAME (frame))) - x_flush (XFRAME (frame)); + /* Flush all displays and so all frames on them. */ + struct x_display_info *xdi; + for (xdi = x_display_list; xdi; xdi = xdi->next) + XFlush (xdi->display); } - else if (FRAME_X_P (f)) - XFlush (FRAME_X_DISPLAY (f)); unblock_input (); }