From 805c26a06412e2af19483976a8a9a892267f29d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 19 Mar 2015 02:18:37 +0100
Subject: user32: Get rid of wineserver call for GetLastInputInfo.

---
 dlls/user32/input.c | 7 +++++++
 server/protocol.def | 4 ++--
 server/queue.c      | 1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 4cf6b61..e63c8cf 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -487,6 +487,7 @@ done:
 BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii)
 {
     BOOL ret;
+    shmglobal_t *shm = wine_get_shmglobal();
 
     TRACE("%p\n", plii);
 
@@ -496,6 +497,12 @@ BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii)
         return FALSE;
     }
 
+    if (shm)
+    {
+        plii->dwTime = shm->last_input_time;
+        return TRUE;
+    }
+
     SERVER_START_REQ( get_last_input_time )
     {
         ret = !wine_server_call_err( req );
diff --git a/server/protocol.def b/server/protocol.def
index 4872251..f12109f 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -71,12 +71,12 @@ struct request_max_size
 
 typedef struct
 {
-    int dummy;
+    unsigned int last_input_time;   /* last input time */
 } shmglobal_t;
 
 typedef struct
 {
-    int queue_bits;     /* queue wake bits */
+    int queue_bits;                 /* queue wake bits */
 } shmlocal_t;
 
 /* debug event data */
diff --git a/server/queue.c b/server/queue.c
index 3d0fef2..37e8c37 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1490,6 +1490,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg
 
     update_key_state( desktop, desktop->keystate, msg );
     last_input_time = get_tick_count();
+    if (shmglobal) shmglobal->last_input_time = last_input_time;
     if (msg->msg != WM_MOUSEMOVE) always_queue = 1;
 
     if (is_keyboard_msg( msg ))
-- 
2.3.5

