Commit Graph

200 Commits

Author SHA1 Message Date
Hans de Goede
deb849dfd5 Rename platform clipboard handling functions
Rename the 4 platform clipboard functions which get called
upon receival of an agent clipboard message to on_clipboard_*

The old set_clipboard_* names were confusing as they suggest being
a class property setter (like set_event_listener) rather then
event handler, and set_clipboard_owner was causing a name conflict
with the next patch in this series.
2010-10-02 15:32:48 +02:00
Hans de Goede
5781c97a17 Move checking for on demand clipboard cap closer to sending of agent messages
This way the events will always get generated and other things
(such as clipboard ownership administration, see the next patches)
can be done in repsonse to the events, even though no message will be send.

This patch also removes the !_agent_caps check from the capability
checks, this is not needed as VD_AGENT_HAS_CAPABILITY checks _agent_caps_size
which will be 0 when _agent_caps is NULL.
2010-10-02 15:32:28 +02:00
Hans de Goede
bc9f00961f Respond to clipb request with an unsupported type with 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.
2010-10-01 20:14:16 +02:00
Hans de Goede
a2d645ffe3 Change VD_AGENT_CLIPBOARD_GRAB to an array of types
A clipboard owner can indicate that it can supply the data the clipboard
owns in multiple formats, so make the data passed with a
VD_AGENT_CLIPBOARD_GRAB message an array of types rather then a single
type.
2010-10-01 20:01:47 +02:00
Hans de Goede
c6e9c52a2a Call intern_atoms() earlier
We call XFixesSelectSelectionInput with the clipboard_atom, so we musr
initialize the atoms before calling XFixesSelectSelectionInput.
2010-10-01 17:02:12 +02:00
Hans de Goede
b882416070 Set clipboard_event before calling send_selection_notify
send_selection_notify used the clipboard_event, so set it before calling
send_selection_notify.
2010-10-01 17:00:28 +02:00
Hans de Goede
1ef6d280d1 wrap XGetAtomName
XGetAtomName() throws X11 errors when called on a None atom, so wrap
it catching the None case.
2010-10-01 16:57:08 +02:00
Arnon Gilboa
c909198eca client: support clipboard/selection-owner model (v2)
-includes most of Hans' review fixes (up to the SelectionRequest comment [4]) & X11 wips sent by Hans (10x!)
-use the VD_AGENT_CLIPBOARD_* types in the platform code
-add ifs for VD_AGENT_CAP_CLIPBOARD_BY_DEMAND in both sides
-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)
-set client as clipboard listener instead of application
-add atexit(cleanup) in win platform

linux:
-instead of clipboard atom selection instead of XA_PRIMARY
-enable USE_XRANDR_1_2 and support clipboard in MultyMonScreen
-send utf8 with no null termination, remove ++size
-add xfixes in configure.ac & Makefile.am

windows:
-bonus: support image cut & paste, currently only on windows

not done yet:
-clipboards formats are still uint32_t, not mime types stores as strings
-platform_win is still used, not the root window
-not replaced the ugly windows CF_DIB in agent/winclient
2010-10-01 16:06:10 +02:00
Alexander Larsson
e5474684d5 client: Avoid crash if platform_win is NULL
This is a temporary fix as this will be fixed for real when
the cut and paste patches land.
2010-09-29 17:48:28 +02:00
Alexander Larsson
92d286c6b5 client: Re-enable USE_XRANDR_1_2
This was disabled by mistake before.
2010-09-29 15:08:05 +02:00
Alexander Larsson
d8faf813e7 client: Don't hardcode -lrt
-lrt is already included in SPICE_NONPKGCONFIG_LIBS if needed so no
need to add it to the command line manually.
2010-09-29 13:37:48 +02:00
Alexander Larsson
3f3283ee17 client: Fall back to gettimeofday if clock_gettime not found 2010-09-29 13:35:18 +02:00
Alexander Larsson
93dc13c91a client: Include config.h from common.h
config.h should be availible everywhere, so move its inclusion
to the top of common.h.
2010-09-29 13:26:21 +02:00
Alexander Larsson
44631aa023 client: Check for pthread yield function using autoconf 2010-09-29 13:16:45 +02:00
Alexander Larsson
8e14489621 client: Include stdint.h for uint32_t 2010-09-29 12:44:33 +02:00
Alexander Larsson
2626419da6 client: Don't use basename for argv[0] in --help output
This isn't what other apps do, and it had issues in the OSX port,
so just remove this.
2010-09-29 12:40:48 +02:00
Alexander Larsson
a5abceccb2 Fix warning from OSX compiler
The OSX compiler warns about uninitialized variable, so we change
a bit how size is initialized.
2010-09-29 12:36:39 +02:00
Hans de Goede
4efeef3302 spicec-x11: Fix going into a never ending loop upon xrandr event (#628573) (v2)
When handling an xrandr event the event_listener->on_monitors_change()
callback destroys and re-creates the monitor object(s) which results
in the DynamicScreen or MultyMonconstructor being called, which triggers
more xrandr events. This causes a never ending event handling loop making
spicec hang, and eventually making the X-server crash as a backlog
of events builds up and it oom's.

This patches this by explictly processing the xrandr event caused
by the constructor inside the constructor surrounded by the already
present guard code against recursive xrandr events.
2010-09-09 16:25:24 +02:00
Alon Levy
c47def6e48 client: add default agent capabilities 2010-08-31 14:30:00 +03:00
Alon Levy
18466b8b55 client: add announce_capabilities 2010-08-31 11:08:09 +03:00
Alexander Larsson
2df2b3df1e client: Handle async errors from xshm setup
XShmAttach can fail asynchronously, so we need to check the
errors in the x error handler during the XSync.
2010-08-25 12:19:46 +02:00
Alexander Larsson
7c7e3efff3 client: Don't leak xshm segments 2010-08-24 10:23:26 +02:00
Alexander Larsson
7c61dfee89 Don't try xshm any more if it fails for a permanent reason
This is copied from how Gtk+ detects Xshm failures.
2010-08-24 10:23:26 +02:00
Yonit Halperin
7b7feaecdf client: Fix for clipboard sending; It wasn't thread safe. 2010-08-23 08:19:26 +03:00
Yonit Halperin
a5194d37e9 client: fix - exit on bad display-effect argument 2010-08-23 08:19:09 +03:00
Alon Levy
01c06d6eaa client: Application::get_screen: fix double SpicePoint size, second hiding the first 2010-07-29 13:22:54 +03:00
Alon Levy
a8f2925162 add eol after #ifdef in jpeg_encoder.h for n900 scratchbox compiler 2010-07-29 11:10:41 +03:00
Alexander Larsson
ccbb922d5a Swap red and blue when decoding 0.4 mjpeg streams
There was an error in how this was encoded in 0.4, which we need
to handle. There is still some issues with the old streams as
the luminocity handling in 0.4 was not correct.
2010-07-20 11:45:37 +02:00
Alexander Larsson
5f664e0ffb Don't send padding over the network with video data 2010-07-20 11:33:57 +02:00
Alexander Larsson
12b08f2c3e codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using
the C struct array-at-end-of-struct. To make this work we also remove
all use of @end for switches (making them C unions).

We drop the zero member of the notify message so that we can avoid this
use of @end for a primitive in the marshaller (plus its useless to send
over the wire).

We change the offsets and stuff in the migration messages to real pointers.
2010-07-19 16:28:22 +02:00
Arnon Gilboa
ce03f5449d client: add clipboard support
* windows - untested
 * linux - small strings both ways, large implemented differently:
  * client to guest - support INCR
  * guest to client - we supply a single possibly very large property
 * requires server changes in next patch to work with spice-vmc
2010-07-19 10:30:19 +03:00
Alon Levy
4f8545ed62 fix typo DisplayModeListner -> DisplayModeListener 2010-07-19 10:28:06 +03:00
Yonit Halperin
9877e7ae84 client: command line arguments for setting windows guest monitors'
color depth and disabling some display options (helpful on WAN)
2010-07-19 09:40:11 +03:00
Alexander Larsson
9d8a76fcd0 Disable tunnel by default on windows 2010-07-08 22:25:32 +02:00
Alexander Larsson
633e962ac3 Make tunnel support optional in client too 2010-07-08 22:25:28 +02:00
Alexander Larsson
ceff16cad6 Make distcheck work 2010-07-08 20:20:35 +02:00
Alexander Larsson
1a6e77d6d4 Fix various misspellings
letancy -> latency
compund -> compound
SpicedSubMessage -> SpiceSubMessage
modifaiers -> modifiers
massage -> message
outgoiong -> outgoing
AlphaBlnd -> AlphaBlend
remoth -> remote
modifires -> modifiers
secore -> secure
2010-07-08 18:26:37 +02:00
Alexander Larsson
9cc1582561 Fix inclusion of common files, no need for common/ part 2010-07-08 15:44:15 +02:00
Alexander Larsson
601aecc8ad Remove unused method declarations 2010-07-08 14:19:45 +02:00
Alexander Larsson
0659fb7897 Move in spice/draw.h from spice-protocol to common/ 2010-07-08 13:56:01 +02:00
Alon Levy
0e16cadc70 Make CEGUI optional
This makes the CEGUI dependency optional and off by default. Restoring
previous behaviour of exiting on disconnect if disabled.
2010-07-01 13:48:58 +02:00
Alexander Larsson
d69fd9408c client: Use ASSERT, not assert 2010-07-01 10:50:12 +02:00
Alexander Larsson
5cd86fc45d Update client and protocol to support the new SpiceClipRects 2010-06-30 22:35:16 +02:00
Yonit Halperin
59152e31f0 client: add --include "common.h" for generated marshallers 2010-06-29 13:59:46 +02:00
Yonit Halperin
270a1e6df3 fixed unhandled destroy screen in Application:restore_screens_size 2010-06-29 13:59:46 +02:00
Yonit Halperin
3ca28ddf28 detaching the screen when the primary surface is destoryed and closing the window if the primary surface is not recreated (the monitor has been detached). 2010-06-29 13:59:46 +02:00
Alexander Larsson
7e26ff3c26 Replace log4cpp with custom log function
Also prints a simpler error to stderr for WARN or above so that
we print something on the commandline if something go wrong.
2010-06-28 21:54:53 +02:00
Alexander Larsson
b08b80d13f Fix build error due to member "SpiceMsgEmpty" same name as type 2010-06-28 12:45:07 +02:00
Alexander Larsson
9655dc30e9 Remove support for clip by path
This is not supported currently anyway and was not generated before.
2010-06-24 14:30:00 +02:00
Alexander Larsson
dc8625c7e1 Make pointers 32bit in new protocol format 2010-06-23 16:33:07 +02:00