Allow exposure compression across configure events [1.2.x]



In Gtk+ 1.2 there is a problem with expose compression when dragging a
window from an app over another window from the same app. In this case the
exposure compression won't work, since every other event is a configure
notify for the dragged window.

This patch allows compression across configure event targeted to a window
other than the toplevel window of the expose event window.

This really speeds up nautilus redrawing performance, is this OK to apply
to the stable Gtk+ branch?

/ Alex

Index: gdkevents.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkevents.c,v
retrieving revision 1.20.2.11
diff -u -p -r1.20.2.11 gdkevents.c
--- gdkevents.c	2000/12/03 16:50:04	1.20.2.11
+++ gdkevents.c	2001/06/01 22:11:34
@@ -383,6 +383,7 @@ typedef struct _GdkExposeInfo GdkExposeI
 struct _GdkExposeInfo
 {
   Window window;
+  Window toplevel_window;
   gboolean seen_nonmatching;
 };

@@ -401,7 +402,9 @@ expose_predicate (Display *display,
    * expose events.
    */
   if (xevent->xany.type != Expose &&
-      xevent->xany.type != GravityNotify)
+      xevent->xany.type != GravityNotify &&
+      (xevent->xany.type != ConfigureNotify ||
+       xevent->xany.window == info->toplevel_window))
     {
       info->seen_nonmatching = TRUE;
     }
@@ -429,6 +432,7 @@ gdk_compress_exposures (XEvent    *xeven
   GdkEvent event;

   info.window = xevent->xany.window;
+  info.toplevel_window = GDK_WINDOW_XWINDOW (gdk_window_get_toplevel (window));
   info.seen_nonmatching = FALSE;

   rect1.x = xevent->xexpose.x;





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