[gtk+] Make process_all_updates draw synchronously



commit 83c66c9c2cf6bf411f7d5ae3c89259203626173a
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Oct 1 10:02:01 2012 +0200

    Make process_all_updates draw synchronously
    
    By calling XSync in _gdk_x11_display_after_process_all_updates we
    effectively make gdk rendering sync, which avoids problems with the
    client animations running faster than the Xserver rendering, thus
    filling up the X rendering pipes and essentially "locking up" the
    Xserver (i.e. you can't even close the offending window because the
    WM is starved too).
    
    I verified this worked by making GtkSpinner paint multiple times on my
    intel driver (which has some issue making this rendering slow atm),
    and without this patch i get severe lag where even window dragging
    stops for 5 seconds when i drag the mouse around. However, with the
    patch everything is smooth.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684639

 gdk/x11/gdkwindow-x11.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 4ef6f46..e4b880f 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -4858,6 +4858,11 @@ _gdk_x11_display_before_process_all_updates (GdkDisplay *display)
 void
 _gdk_x11_display_after_process_all_updates (GdkDisplay *display)
 {
+  /* Sync after all drawing, otherwise the client can get "ahead" of
+     the server rendering during animations, such that we fill up
+     the Xserver pipes with sync rendering ops not letting other
+     clients (including the VM) do anything. */
+  XSync (GDK_DISPLAY_XDISPLAY (display), FALSE);
 }
 
 static Bool



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]