diff options
author | Arnon Gilboa <agilboa@agilboa.usersys.redhat.com> | 2010-06-06 12:51:04 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2010-08-23 18:52:34 +0300 |
commit | c909771c0e6f7a529d0ec614d57dcd500b500990 (patch) | |
tree | 6231684968aee1e2d935523b6d9f97b023fe9587 /vdagent/vdagent.cpp | |
parent | b850d5a8c79b96dbe884276cef9feee0c3e8c424 (diff) |
spice: vdagent: drop mouse event when SendInput fails due to DesktopSwitch event delay #598968
Diffstat (limited to 'vdagent/vdagent.cpp')
-rw-r--r-- | 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) |