Commit Graph

37 Commits

Author SHA1 Message Date
Arnon Gilboa
2d03cc5c2c vdservice stops vdagent via event
Terminate agent politely instead of ugly TerminateProcess(), so now
VD_AGENT_CLIPBOARD_RELEASE is sent (if guest owned the clipboard),
followed by cleanup.

rhbz #903379
2013-01-31 11:34:14 +02:00
Arnon Gilboa
f1873dfa9b vdagent: remove vdi_port, use vio_serial directly 2012-12-09 11:33:25 +02:00
Arnon Gilboa
9b5954165d vdagent: when SetClipboardData fails, set clipboard control event to stop wait
Currently, a SetClipboardData failure is followed by useless wait for timeout
(VD_CLIPBOARD_TIMEOUT_MS).

In addition, we remove the clipboard open-empty-set-close retry, which became
irrelevant with the current on_clipboard_request().
2012-12-09 11:24:27 +02:00
Arnon Gilboa
7330f5132a vdagent: remove a wrong return 2012-11-18 12:13:40 +02:00
Arnon Gilboa
a69af07da3 vdagent: set timeout for next clipboard chunk instead of complete reception
currently:
-handling client disconnect during clipboard data trasfer is buggy
-agent also timeouts on large paste from client (>10sec)

therfore:
-reduce VD_CLIPBOARD_TIMEOUT_MS to 3sec from previous clipboard chunk
-remove _clipboard_event and use _control_event(CONTROL_CLIPBOARD) instead
-use _clipboard_tick for clipboard timeout, updated on each clipboard chunk
-use cleanup_in_msg() to reset incoming message state

rhbz#833835
2012-11-14 10:50:52 +02:00
Arnon Gilboa
f71197330c vdagent: extract event_dispatcher from input_desktop_message_loop 2012-11-14 10:50:51 +02:00
Arnon Gilboa
22d25256fd vdagent: use virtio-serial, remove pipe usage 2012-11-14 10:50:51 +02:00
Arnon Gilboa
900ef2b4db vdagent: don't stop due to UIPI blocking
User Interface Privilege Isolation is usually used only for specific windows of
system security applications (anti-viruses etc.), so with this patch mouse will
be irresponsive for these windows but keep working for the rest. A complete
solution might be switching to server mouse mode while the agent is still active.
2012-09-10 10:17:23 +03:00
Arnon Gilboa
4e95b73ecf vdagent: add message_queue for messages written to pipe
This is only part of the message corruption solution.
The other part is fixing virtio-serial / spice-qemu-char throttling code.

-replace write_[lock/unlock/completion] calls with [new/enqueue]_message
-remove clipboard specific _out_msg_* class members
-remove ugly loop - while (a->_out_msg && a->write_clipboard());
-add _message_mutex for message queue
-fix pending_write race using _write_mutex
-TODO: enqueue large message without dividing it to chunks in advance

rhbz #846427
2012-09-10 09:48:46 +03:00
Marc-André Lureau
04a28a35ed Fix remaining warnings 2012-07-25 11:27:22 +02:00
Marc-André Lureau
0cef8ba42b vdagent: reset clipboard event
Waiting for a Windows event will not last if it is already set.

For example, the client may send clipboard_release() messages
while we are not waiting in on_clipboard_request(), and this will
SetEvent(clipboard_event)
The following clipboard request will thus not wait for the data,
resulting in an empty clipboard & paste for the guest application.

We could say there is fundamentally a race as there is no obvious
way to know if a received message is related to the current request,
but by reseting the event before waiting for new events to come, we
at least clear the past events.
2012-05-25 20:21:54 +02:00
Marc-André Lureau
b4b7105c57 mingw: add standard main() entry function
Thanks Paolo for the suggestion:
http://lists.freedesktop.org/archives/spice-devel/2012-May/009291.html
2012-05-24 13:53:43 +02:00
Christophe Fergeau
74af857e8e Revert "mingw: remove tMain use"
This patch wasn't sent for review, and wasn't meant to be pushed
as part of the mingw series

This reverts commit 63541ea6ac.
2012-03-01 16:58:18 +01:00
Christophe Fergeau
6670fc556a Fix spacing in VDAgent initialization list
The convention in vdagent codebase seems to put a space before
the opening parenthesis in initialization list, this commit fixes
2 inconsistencies related to that.
2012-03-01 14:32:39 +01:00
Christophe Fergeau
63541ea6ac mingw: remove tMain use
mingw does not support it.
2012-03-01 12:59:05 +01:00
Christophe Fergeau
b1e2f1a8ed mingw: fix another signed/unsigned warning
VDAgent::_mouse_x and VDAgent::_mouse_y are both signed but are
always assigned values from VDAgentMouseState which are unsigned.
gcc warns about this so change them to unsigned values.
2012-03-01 12:59:05 +01:00
Christophe Fergeau
ff0a9e72b3 mingw: workaround ximage.h #defining min/max
This confuses the deque implementation of gcc which uses std::min
std::max and causes compile failure.
2012-03-01 12:59:05 +01:00
Christophe Fergeau
92583e91d4 mingw: workaround "use of unitialized var" warning
mingw warns about using a variable before it's initialized, but
it's a false alarm. Initialize it to 0 to avoid the warning.
2012-03-01 12:59:05 +01:00
Christophe Fergeau
bc99951685 mingw: use unsigned int in for loops when needed
gcc complains about mixed use of signed/unsigned otherwise
2012-03-01 12:59:05 +01:00
Christophe Fergeau
52d6594284 mingw: fix initialization list order for VDAgent() 2012-03-01 12:58:29 +01:00
Christophe Fergeau
df3fe9cb90 mingw: fix format string warnings
Most of them are caused by not using %lu to print a DWORD (which
is an unsigned long).
2012-02-23 19:03:25 +01:00
Arnon Gilboa
28d7028278 vdagent: release clipboard ownership on agent stop & desktop switch rhbz#731628
-use event queue for agent stop & desktop switch
-exit gracefully on session end
2011-11-16 12:09:46 +02:00
Arnon Gilboa
d896c004e5 vdagent: remove whitespaces 2011-07-24 18:08:03 +03:00
Arnon Gilboa
97f69ccade vdagent: add image copy-paste support
-currently png & bmp
-using wspice libs cximage.lib & png.lib
-jpg & tiff will follow
2010-11-23 17:19:55 +02:00
Arnon Gilboa
1e7f9e85a7 vdagent: handle multiple types on clipboard grab send & receive 2010-10-11 15:10:04 +02:00
Arnon Gilboa
d9c16de429 vdagent: remove clipboard_changer hack
Instead of keeping a flag, we simply check wether the new owner is usor not
2010-10-06 16:35:55 +02:00
Arnon Gilboa
f58826a83f vdagent: Keep track of clipboard ownership
Given that all clipboard handling is async, it is possible to for
example receive a request for clipboard data from the client
while the agent no longer owns the clipboard (ie a
VD_AGENT_CLIPBOARD_RELEASE message is in transit to the client).

Thus it is necessary to keep track of our notion of clipboard ownership
and check received clipboard messages (both from other apps on the client
machine and from the agent) to see if they match our notion and if not
drop, or in case were a counter message is expected nack the clipboard
message.(citing hansg)

clean ups: capability checks, return values
2010-10-06 13:31:15 +02:00
Arnon Gilboa
1d095da5d8 vdagent: receiving a clipboard request with an unsupported type is replied by data with a none type
Currently we send a VD_AGENT_CLIPBOARD_RELEASE when we receive a
VD_AGENT_CLIPBOARD_REQUEST with a type which we do not support. This is not
correct, as this means given up clipboard ownership while we may be able
to answer requests with different types. The correct response is to
nack the request by sending a VD_AGENT_CLIPBOARD (data) message with a type
of VD_AGENT_CLIPBOARD_NONE.(citing hansg)
2010-10-05 16:02:52 +02:00
Arnon Gilboa
9115c03973 vdagent: remove windows-specific bitmap cut & paste support
will wait until png comes in
2010-10-05 15:27:53 +02:00
Arnon Gilboa
23b5c1e068 vdagent: support & check VD_AGENT_CAP_CLIPBOARD_BY_DEMAND
cleanup, rename change -> grab, render->request
2010-09-29 14:24:44 +02:00
Arnon Gilboa
f2f2f874e1 vd_agent: support clipboard/selection-owner model
-enable the clipboard support
-support the GRAB/REQUEST/DATA/RELEASE verbs in both ways.
-pasting clipboard data is now "only-by-demand" from both sides (client and agent), whose behavior is symmetric.
-client and agent don't read or send the contents of the clipboard unnecessarily (e.g. copy, internal paste, repeating paste, focus change)
-bonus (no cost): support image cut & paste, currently only with win client
2010-09-21 19:14:17 +02:00
Alon Levy
f6bb602d07 vdagent: support announce_capabilities 2010-08-31 11:11:20 +03:00
Yonit Halperin
5833dc9760 Controlling Windows display settings (e.g., wallpaper, UI effects and font smoothing)
The configuration is received from Spice client.
The main usage of this option is for disabling display features in order to accelerate Spice performance over limited network connections.
2010-08-24 10:36:05 +03:00
Arnon Gilboa
8eb3e2e816 vdagent: support basic clipboard support (disabled by default)
-add CLIPBOARD_ENABLED ifdefs in the agent for disabling clipboard support
 -currently supports text only (UTF8)
2010-08-23 18:54:30 +03:00
Arnon Gilboa
81cd5620d2 vdservice/vdagent: fixes leading to clipboard (aka large) message handling
-add VDAgent::dispatch_message()
-in VDAgent::read_completion() handle multi-chunk msgs
-fix chunk size bug in VDService::handle_pipe_data()
-add size to VDPipeMessage
2010-08-23 18:54:25 +03:00
Arnon Gilboa
c909771c0e spice: vdagent: drop mouse event when SendInput fails due to DesktopSwitch event delay #598968 2010-08-23 18:52:34 +03:00
Arnon Gilboa
5ee7b5b270 fresh start 2009-11-05 13:02:54 +02:00