server: Return the time of last change along with the current cursor position.
diff --git a/server/protocol.def b/server/protocol.def
index aaaebc0..f8fc82b 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3324,6 +3324,7 @@
     int            new_x;         /* new position */
     int            new_y;
     rectangle_t    new_clip;      /* new clip rectangle */
+    unsigned int   last_change;   /* time of last position change */
 @END
 #define SET_CURSOR_HANDLE 0x01
 #define SET_CURSOR_COUNT  0x02
diff --git a/server/queue.c b/server/queue.c
index f6ac303..35448e5 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1281,6 +1281,7 @@
 {
     desktop->cursor.x = min( max( x, desktop->cursor.clip.left ), desktop->cursor.clip.right - 1 );
     desktop->cursor.y = min( max( y, desktop->cursor.clip.top ), desktop->cursor.clip.bottom - 1 );
+    desktop->cursor.last_change = get_tick_count();
 }
 
 /* queue a hardware message into a given thread input */
@@ -1411,9 +1412,10 @@
         WM_MOUSEHWHEEL   /* 0x1000 = MOUSEEVENTF_HWHEEL */
     };
 
+    desktop->cursor.last_change = get_tick_count();
     flags = input->mouse.flags;
     time  = input->mouse.time;
-    if (!time) time = get_tick_count();
+    if (!time) time = desktop->cursor.last_change;
 
     if (flags & MOUSEEVENTF_MOVE)
     {
@@ -2624,7 +2626,8 @@
             input->desktop->cursor.clip = top_rect;
     }
 
-    reply->new_x    = input->desktop->cursor.x;
-    reply->new_y    = input->desktop->cursor.y;
-    reply->new_clip = input->desktop->cursor.clip;
+    reply->new_x       = input->desktop->cursor.x;
+    reply->new_y       = input->desktop->cursor.y;
+    reply->new_clip    = input->desktop->cursor.clip;
+    reply->last_change = input->desktop->cursor.last_change;
 }
diff --git a/server/request.h b/server/request.h
index 47733a5..c2104e9 100644
--- a/server/request.h
+++ b/server/request.h
@@ -2103,7 +2103,8 @@
 C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_x) == 16 );
 C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_y) == 20 );
 C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, new_clip) == 24 );
-C_ASSERT( sizeof(struct set_cursor_reply) == 40 );
+C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, last_change) == 40 );
+C_ASSERT( sizeof(struct set_cursor_reply) == 48 );
 
 #endif  /* WANT_REQUEST_HANDLERS */
 
diff --git a/server/trace.c b/server/trace.c
index 0933cf1..553ba4d 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -3905,6 +3905,7 @@
     fprintf( stderr, ", new_x=%d", req->new_x );
     fprintf( stderr, ", new_y=%d", req->new_y );
     dump_rectangle( ", new_clip=", &req->new_clip );
+    fprintf( stderr, ", last_change=%08x", req->last_change );
 }
 
 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
diff --git a/server/user.h b/server/user.h
index 52a44a6..cc603cf 100644
--- a/server/user.h
+++ b/server/user.h
@@ -56,6 +56,7 @@
     int                  x;                /* cursor position */
     int                  y;
     rectangle_t          clip;             /* cursor clip rectangle */
+    unsigned int         last_change;      /* time of last position change */
 };
 
 struct desktop