Alexandre Julliard : winex11: Don' t process ConfigureNotify events that have been superseded by a later configure request .

Alexandre Julliard julliard at winehq.org
Tue Jan 5 11:37:50 CST 2010


Module: wine
Branch: master
Commit: 00b06dac85c096f20f7beed8898553166f07e6ad
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=00b06dac85c096f20f7beed8898553166f07e6ad

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan  4 17:56:32 2010 +0100

winex11: Don't process ConfigureNotify events that have been superseded by a later configure request.

---

 dlls/winex11.drv/event.c  |   11 +++++++++--
 dlls/winex11.drv/window.c |   12 +++++++-----
 dlls/winex11.drv/x11drv.h |    1 +
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 32eb64a..63fb5c1 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -308,8 +308,8 @@ static inline void call_event_handler( Display *display, XEvent *event )
         hwnd = 0;  /* not for a registered window */
     if (!hwnd && event->xany.window == root_window) hwnd = GetDesktopWindow();
 
-    TRACE( "%s for hwnd/window %p/%lx\n",
-           dbgstr_event( event->type ), hwnd, event->xany.window );
+    TRACE( "%lu %s for hwnd/window %p/%lx\n",
+           event->xany.serial, dbgstr_event( event->type ), hwnd, event->xany.window );
     wine_tsx11_unlock();
     thread_data = x11drv_thread_data();
     prev = thread_data->current_event;
@@ -829,6 +829,13 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
     if (!hwnd) return;
     if (!(data = X11DRV_get_win_data( hwnd ))) return;
     if (!data->mapped || data->iconic || !data->managed) return;
+    if (data->configure_serial && (long)(data->configure_serial - event->serial) > 0)
+    {
+        TRACE( "win %p/%lx event %d,%d,%dx%d ignoring old serial %lu/%lu\n",
+               hwnd, data->whole_window, event->x, event->y, event->width, event->height,
+               event->serial, data->configure_serial );
+        return;
+    }
 
     /* Get geometry */
 
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 5df7df2..ec7f6dd 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1321,16 +1321,18 @@ static void sync_window_position( Display *display, struct x11drv_win_data *data
         /* and Above with a sibling doesn't work so well either, so we ignore it */
     }
 
-    TRACE( "setting win %p/%lx pos %d,%d,%dx%d after %lx changes=%x\n",
-           data->hwnd, data->whole_window, data->whole_rect.left, data->whole_rect.top,
-           data->whole_rect.right - data->whole_rect.left,
-           data->whole_rect.bottom - data->whole_rect.top, changes.sibling, mask );
-
     wine_tsx11_lock();
     set_size_hints( display, data, style );
+    data->configure_serial = NextRequest( display );
     XReconfigureWMWindow( display, data->whole_window,
                           DefaultScreen(display), mask, &changes );
     wine_tsx11_unlock();
+
+    TRACE( "win %p/%lx pos %d,%d,%dx%d after %lx changes=%x serial=%lu\n",
+           data->hwnd, data->whole_window, data->whole_rect.left, data->whole_rect.top,
+           data->whole_rect.right - data->whole_rect.left,
+           data->whole_rect.bottom - data->whole_rect.top,
+           changes.sibling, mask, data->configure_serial );
 }
 
 
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 62e275d..9be93c6 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -741,6 +741,7 @@ struct x11drv_win_data
     BOOL        shaped : 1;     /* is window using a custom region shape? */
     int         wm_state;       /* current value of the WM_STATE property */
     DWORD       net_wm_state;   /* bit mask of active x11drv_net_wm_state values */
+    unsigned long configure_serial; /* serial number of last configure request */
     HBITMAP     hWMIconBitmap;
     HBITMAP     hWMIconMask;
 };




More information about the wine-cvs mailing list