Commit 06948ebc authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Update the cursor on the clip window when the pointer grab starts.

parent ad32b28a
......@@ -194,7 +194,7 @@ void set_window_cursor( Window window, HCURSOR handle )
/***********************************************************************
* sync_window_cursor
*/
void sync_window_cursor( struct x11drv_win_data *data )
void sync_window_cursor( Window window )
{
HCURSOR cursor;
......@@ -206,11 +206,7 @@ void sync_window_cursor( struct x11drv_win_data *data )
}
SERVER_END_REQ;
if (data->cursor != cursor)
{
data->cursor = cursor;
set_window_cursor( data->whole_window, cursor );
}
set_window_cursor( window, cursor );
}
/***********************************************************************
......@@ -253,7 +249,7 @@ static void send_mouse_input( HWND hwnd, UINT flags, Window window, int x, int y
if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
GetTickCount() - last_cursor_change > 100)
{
sync_window_cursor( data );
sync_window_cursor( data->whole_window );
last_cursor_change = GetTickCount();
}
......@@ -964,6 +960,7 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip )
if (clipping_cursor)
{
sync_window_cursor( clip_window );
clip_rect = *clip;
return TRUE;
}
......
......@@ -1715,10 +1715,7 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
XFlush( display ); /* make sure the window exists before we start painting to it */
wine_tsx11_unlock();
sync_window_cursor( data );
/* setting the cursor can fail if the window isn't created yet */
/* so make sure that we try again once we receive a mouse event */
data->cursor = (HANDLE)~0u;
sync_window_cursor( data->whole_window );
done:
if (win_rgn) DeleteObject( win_rgn );
......@@ -2701,10 +2698,7 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
return 0;
case WM_X11DRV_SET_CURSOR:
if ((data = X11DRV_get_win_data( hwnd )) && data->whole_window)
{
data->cursor = (HCURSOR)lp;
set_window_cursor( data->whole_window, data->cursor );
}
set_window_cursor( data->whole_window, (HCURSOR)lp );
return 0;
default:
FIXME( "got window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, wp, lp );
......
......@@ -771,7 +771,6 @@ struct x11drv_win_data
RECT whole_rect; /* X window rectangle for the whole window relative to parent */
RECT client_rect; /* client area relative to parent */
XIC xic; /* X input context */
HCURSOR cursor; /* current cursor */
XWMHints *wm_hints; /* window manager hints */
BOOL managed : 1; /* is window managed? */
BOOL mapped : 1; /* is window mapped? (in either normal or iconic state) */
......@@ -822,7 +821,7 @@ extern void X11DRV_Clipboard_Cleanup(void);
extern void X11DRV_ResetSelectionOwner(void);
extern void CDECL X11DRV_SetFocus( HWND hwnd );
extern void set_window_cursor( Window window, HCURSOR handle );
extern void sync_window_cursor( struct x11drv_win_data *data );
extern void sync_window_cursor( Window window );
extern BOOL CDECL X11DRV_ClipCursor( LPCRECT clip );
extern void X11DRV_InitKeyboard( Display *display );
extern DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
......
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