From: Arnon Gilboa <agil...@agilboa.usersys.redhat.com>

---
 vdagent/vdagent.cpp |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index 332438b..a578dfd 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -262,7 +262,7 @@ DWORD VDAgent::get_buttons_change(DWORD last_buttons_state, 
DWORD new_buttons_st
 
 bool VDAgent::send_input()
 {
-    UINT ret;
+    bool ret = true;
     _desktop_layout->lock();
     if (_pending_input) {
         if (KillTimer(_hwnd, VD_TIMER_ID)) {
@@ -274,14 +274,13 @@ bool VDAgent::send_input()
             return false;
         }
     }
-    ret = SendInput(1, &_input, sizeof(INPUT));
-    if (!ret) {
+    if (!SendInput(1, &_input, sizeof(INPUT)) && GetLastError() != 
ERROR_ACCESS_DENIED) {
         vd_printf("SendInput failed: %d", GetLastError());
-        _running = false;
+        ret = _running = false;
     }
     _input_time = GetTickCount();
     _desktop_layout->unlock();
-    return !!ret;
+    return ret;
 }
 
 bool VDAgent::handle_mouse_event(VDAgentMouseState* state)
-- 
1.5.5.6

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to