Alexandre Julliard : winex11: Take into account the cursor show count when setting the initial cursor for a window .

Alexandre Julliard julliard at winehq.org
Mon May 10 11:59:14 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon May 10 12:33:59 2010 +0200

winex11: Take into account the cursor show count when setting the initial cursor for a window.

---

 dlls/winex11.drv/window.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 8cd3bf3..28d5ae6 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -425,6 +425,25 @@ static void sync_window_style( Display *display, struct x11drv_win_data *data )
 
 
 /***********************************************************************
+ *              sync_window_cursor
+ */
+static void sync_window_cursor( struct x11drv_win_data *data )
+{
+    HCURSOR cursor;
+
+    SERVER_START_REQ( set_cursor )
+    {
+        req->flags = 0;
+        wine_server_call( req );
+        cursor = reply->prev_count >= 0 ? wine_server_ptr_handle( reply->prev_handle ) : 0;
+    }
+    SERVER_END_REQ;
+
+    set_window_cursor( data->hwnd, cursor );
+}
+
+
+/***********************************************************************
  *              sync_window_region
  *
  * Update the X11 window region.
@@ -1053,7 +1072,6 @@ static void set_initial_wm_hints( Display *display, struct x11drv_win_data *data
     Atom dndVersion = WINE_XDND_VERSION;
     XClassHint *class_hints;
     char *process_name = get_process_name();
-    Cursor cursor;
 
     wine_tsx11_lock();
 
@@ -1086,9 +1104,6 @@ static void set_initial_wm_hints( Display *display, struct x11drv_win_data *data
     XChangeProperty( display, data->whole_window, x11drv_atom(XdndAware),
                      XA_ATOM, 32, PropModeReplace, (unsigned char*)&dndVersion, 1 );
 
-    if ((cursor = get_x11_cursor( data->cursor )))
-        XDefineCursor( gdi_display, data->whole_window, cursor );
-
     data->wm_hints = XAllocWMHints();
     wine_tsx11_unlock();
 
@@ -1681,6 +1696,8 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
     wine_tsx11_lock();
     XFlush( display );  /* make sure the window exists before we start painting to it */
     wine_tsx11_unlock();
+
+    sync_window_cursor( data );
 done:
     if (win_rgn) DeleteObject( win_rgn );
     return data->whole_window;




More information about the wine-cvs mailing list