From b7f79bae86e62dd642f52145c0f480ba44e56a79 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 3 Jun 2015 16:02:11 +0900 Subject: [PATCH] server: Use a standard timestamp for the clipboard. --- server/clipboard.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/server/clipboard.c b/server/clipboard.c index 0c39319f142..8f267030999 100644 --- a/server/clipboard.c +++ b/server/clipboard.c @@ -30,6 +30,7 @@ #define WIN32_NO_STATUS #include "request.h" #include "object.h" +#include "file.h" #include "process.h" #include "user.h" #include "winuser.h" @@ -44,7 +45,7 @@ struct clipboard user_handle_t owner_win; /* window that owns the clipboard data */ user_handle_t viewer; /* first window in clipboard viewer list */ unsigned int seqno; /* clipboard change sequence number */ - time_t seqno_timestamp; /* time stamp of last seqno increment */ + timeout_t seqno_timestamp; /* time stamp of last seqno increment */ }; static void clipboard_dump( struct object *obj, int verbose ); @@ -70,7 +71,7 @@ static const struct object_ops clipboard_ops = }; -#define MINUPDATELAPSE 2 +#define MINUPDATELAPSE (2 * TICKS_PER_SEC) /* dump a clipboard object */ static void clipboard_dump( struct object *obj, int verbose ) @@ -178,11 +179,9 @@ static int set_clipboard_owner( struct clipboard *clipboard, user_handle_t win, static int get_seqno( struct clipboard *clipboard ) { - time_t tm = time(NULL); - - if (!clipboard->owner_thread && (tm > (clipboard->seqno_timestamp + MINUPDATELAPSE))) + if (!clipboard->owner_thread && (current_time - clipboard->seqno_timestamp > MINUPDATELAPSE)) { - clipboard->seqno_timestamp = tm; + clipboard->seqno_timestamp = current_time; clipboard->seqno++; } return clipboard->seqno;