Module: wine Branch: master Commit: 220f1af06493e0c4623c2195435d993be275b3d5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=220f1af06493e0c4623c219543...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Sep 19 13:13:51 2012 +0200
winex11: Add window data structure locking to the GravityNotify event handler.
---
dlls/winex11.drv/event.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 744bc40..2a4fda7 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1100,10 +1100,16 @@ done: static void X11DRV_GravityNotify( HWND hwnd, XEvent *xev ) { XGravityEvent *event = &xev->xgravity; - struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); - RECT rect; + struct x11drv_win_data *data = get_win_data( hwnd ); + RECT rect, window_rect;
- if (!data || data->whole_window) return; /* only handle this for foreign windows */ + if (!data) return; + + if (data->whole_window) /* only handle this for foreign windows */ + { + release_win_data( data ); + return; + }
rect.left = event->x; rect.top = event->y; @@ -1115,8 +1121,10 @@ static void X11DRV_GravityNotify( HWND hwnd, XEvent *xev ) event->x, event->y );
X11DRV_X_to_window_rect( data, &rect ); + window_rect = data->window_rect; + release_win_data( data );
- if (data->window_rect.left != rect.left || data ->window_rect.top != rect.top) + if (window_rect.left != rect.left || window_rect.top != rect.top) SetWindowPos( hwnd, 0, rect.left, rect.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS ); }