Commit 313157a0 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Add window data structure locking to the remaining entry points.

parent b515beb4
...@@ -177,7 +177,7 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam ...@@ -177,7 +177,7 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam
struct desktop_resize_data *resize_data = (struct desktop_resize_data *)lparam; struct desktop_resize_data *resize_data = (struct desktop_resize_data *)lparam;
int mask = 0; int mask = 0;
if (!(data = X11DRV_get_win_data( hwnd ))) return TRUE; if (!(data = get_win_data( hwnd ))) return TRUE;
/* update the full screen state */ /* update the full screen state */
update_net_wm_states( data ); update_net_wm_states( data );
...@@ -193,6 +193,7 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam ...@@ -193,6 +193,7 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam
XReconfigureWMWindow( data->display, data->whole_window, XReconfigureWMWindow( data->display, data->whole_window,
DefaultScreen(data->display), mask, &changes ); DefaultScreen(data->display), mask, &changes );
} }
release_win_data( data );
if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, TRUE ); if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, TRUE );
return TRUE; return TRUE;
} }
......
...@@ -1671,24 +1671,6 @@ void release_win_data( struct x11drv_win_data *data ) ...@@ -1671,24 +1671,6 @@ void release_win_data( struct x11drv_win_data *data )
/*********************************************************************** /***********************************************************************
* X11DRV_get_win_data
*
* Return the X11 data structure associated with a window.
*/
struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd )
{
struct x11drv_win_data *data = get_win_data( hwnd );
if (data)
{
release_win_data( data );
if (GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) data = NULL;
}
return data;
}
/***********************************************************************
* X11DRV_create_win_data * X11DRV_create_win_data
* *
* Create an X11 data window structure for an existing window. * Create an X11 data window structure for an existing window.
...@@ -1882,7 +1864,6 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, ...@@ -1882,7 +1864,6 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
const RECT *top_rect, DWORD flags ) const RECT *top_rect, DWORD flags )
{ {
struct x11drv_escape_set_drawable escape; struct x11drv_escape_set_drawable escape;
struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
HWND parent; HWND parent;
escape.code = X11DRV_SET_DRAWABLE; escape.code = X11DRV_SET_DRAWABLE;
...@@ -1897,10 +1878,13 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, ...@@ -1897,10 +1878,13 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
if (top == hwnd) if (top == hwnd)
{ {
struct x11drv_win_data *data = get_win_data( hwnd );
escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd ); escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd );
/* special case: when repainting the root window, clip out top-level windows */ /* special case: when repainting the root window, clip out top-level windows */
if (data && data->whole_window == root_window) escape.mode = ClipByChildren; if (data && data->whole_window == root_window) escape.mode = ClipByChildren;
release_win_data( data );
} }
else else
{ {
...@@ -2372,8 +2356,11 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -2372,8 +2356,11 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
X11DRV_resize_desktop( LOWORD(lp), HIWORD(lp) ); X11DRV_resize_desktop( LOWORD(lp), HIWORD(lp) );
return 0; return 0;
case WM_X11DRV_SET_CURSOR: case WM_X11DRV_SET_CURSOR:
if ((data = X11DRV_get_win_data( hwnd )) && data->whole_window) if ((data = get_win_data( hwnd )))
set_window_cursor( data->whole_window, (HCURSOR)lp ); {
if (data->whole_window) set_window_cursor( data->whole_window, (HCURSOR)lp );
release_win_data( data );
}
else if (hwnd == x11drv_thread_data()->clip_hwnd) else if (hwnd == x11drv_thread_data()->clip_hwnd)
set_window_cursor( x11drv_thread_data()->clip_window, (HCURSOR)lp ); set_window_cursor( x11drv_thread_data()->clip_window, (HCURSOR)lp );
return 0; return 0;
......
...@@ -557,7 +557,6 @@ struct x11drv_win_data ...@@ -557,7 +557,6 @@ struct x11drv_win_data
extern struct x11drv_win_data *get_win_data( HWND hwnd ) DECLSPEC_HIDDEN; extern struct x11drv_win_data *get_win_data( HWND hwnd ) DECLSPEC_HIDDEN;
extern void release_win_data( struct x11drv_win_data *data ) DECLSPEC_HIDDEN; extern void release_win_data( struct x11drv_win_data *data ) DECLSPEC_HIDDEN;
extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd ) DECLSPEC_HIDDEN;
extern Window X11DRV_get_whole_window( HWND hwnd ) DECLSPEC_HIDDEN; extern Window X11DRV_get_whole_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN; extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment