Alexandre Julliard : winex11: Update the window cursor at most once every 100ms if nothing changed.

Alexandre Julliard julliard at winehq.org
Thu Feb 24 11:43:24 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Feb 24 12:14:58 2011 +0100

winex11: Update the window cursor at most once every 100ms if nothing changed.

---

 dlls/winex11.drv/mouse.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index be55085..794056b 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -265,8 +265,12 @@ static HWND update_mouse_state( HWND hwnd, Window window, int x, int y, unsigned
         pt->x = data->client_rect.right - data->client_rect.left - 1 - pt->x;
     MapWindowPoints( hwnd, 0, pt, 1 );
 
-    cursor_window = hwnd;
-    sync_window_cursor( data );
+    if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
+        GetTickCount() - last_time_modified > 100)
+    {
+        cursor_window = hwnd;
+        sync_window_cursor( data );
+    }
     if (hwnd != GetDesktopWindow()) hwnd = GetAncestor( hwnd, GA_ROOT );
 
     /* update the wine server Z-order */




More information about the wine-cvs mailing list