Commit Graph

39 Commits

Author SHA1 Message Date
Daniel P. Berrange
68c2897e5b Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
Yonit Halperin
8131249d6c client: fix for redundant shift+f11 RHBZ #674532
After shift+F11, both in Windows 7 and xp clients, WM_KEYUP events were missing for
SHIFT and F11. For F11 it was less important since unpress_all was preformed for all keys.
However, we perform sync for all the keyboard modifiers and the GetKeyboardState returns "down" for shift.
In windows7 client, we sometimes received afterwards a F11 KEYDOWN event repetition, and this caused SHIFT+F11 to be called again.
Not performing hiding of the windows while changing client resolutions, solved the problem of missing events, and I don't see any difference
in how spice looks while toggling to full screen.
Using GetAsyncKeyState, returns "UP" for shift in windows 7, and helps avoid performing shift+f11 again, if there is an F11 repetition
before we receive the KEYUP event for shift.
2011-06-14 10:15:41 +03:00
Marc-André Lureau
27f771566d common: add windows.h where required, make gdi_handlers static
This patch has not been verified with VS/brew. It should be safe
hopefully. Compilation is fine with mingw32/spice-gtk.
2011-05-03 16:49:56 +02:00
Christophe Fergeau
78c1465ed3 add #include <config.h> to all source files
When using config.h, it must be the very first include in all source
files since it contains #define that may change the compilation process
(eg libc structure layout changes when it's used to enable large file
support on 32 bit x86 archs). This commit adds it at the beginning
of all .c and .cpp files
2011-05-03 14:44:10 +02:00
Alon Levy
42f83d18b5 client/windows: don't allocate console unless required 2011-01-27 17:19:07 +02:00
Alon Levy
1bb1bcb9a0 mingw32 build: check for CXImage, disable if not found (only on mingw32)
v2:
 + simplify (Hans)
 + also report presence of cximage for mingw32 target
2010-12-08 17:13:52 +02:00
Alon Levy
a19080980d mingw32 build: eol fixes 2010-12-08 17:12:48 +02:00
Alon Levy
9728ea7f5c mingw32 build: remove unused, initialize uninitialized, reorder constructor initializers 2010-12-08 17:11:45 +02:00
Alon Levy
d14b720a3f mingw32 build: fix assignement as condition warning 2010-12-08 17:11:45 +02:00
Alon Levy
06749bd66b mingw32 build: fix signed/unsigned warnings as errors 2010-12-08 17:11:45 +02:00
Arnon Gilboa
dd31c0cbfd spicec-win: add image copy-paste support
-currently png & bmp
-using wspice libs cximage.lib & png.lib
-jpg & tiff will follow
2010-11-24 10:30:40 +02:00
Arnon Gilboa
57cea3235f spice-win: handle multiple types on clipboard grab send & receive 2010-10-11 17:29:46 +02:00
Arnon Gilboa
1148edfea4 spice-win: remove clipboard_changer hack
Instead of keeping a flag, we simply check wether the new owner is us or not
2010-10-11 17:29:44 +02:00
Arnon Gilboa
f2ef521740 spice-win: handle type VD_AGENT_CLIPBOARD_NONE in Platform::on_clipboard_notify() 2010-10-11 17:29:43 +02:00
Arnon Gilboa
26814c4f9c spice-win: remove windows-specific bitmap cut & paste support
will wait until png comes in
2010-10-11 17:29:00 +02:00
Hans de Goede
7b84db7a74 spicec: Move setting of clipboard_owner to guest to platform code
Atleast under x11 there is a race condition when setting the clipboard
owner to guest from the RedClient code rather then doing it in Platform.

After the XSetSelectionOwner() in Platform::on_clipboard_grab(), which runs
from the main message loop thread, the x11 event thread can receive a
SelectionRequest event from another x11 app, before the RedClient code
has set the clipboard owner, which will trigger the owner != guest
check in the SelectionRequest event handling code.

By moving the setting of the owner in to Platform::on_clipboard_grab() it
gets protected by the clipboard lock, which closes this tiny race.
2010-10-06 19:17:08 +02:00
Hans de Goede
aabca2864d spicec-x11: Force processing of ownerchange event when releasing the cb
Make sure we process the XFixesSetSelectionOwnerNotify event caused by
us setting the clipboard owner to none, directly after setting the owner
to none. Otherwise we may end up changing the clipboard owner to none, after
it has already been re-owned because the XFixesSetSelectionOwnerNotify event
to owner none is event is still pending when we set the new owner, and
then changes the owner back to none once processed messing up our clipboard
ownership state tracking.

I saw this happening when doing copy twice in succession inside the guest.
2010-10-04 11:49:14 +02:00
Hans de Goede
8a160078d0 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 agent
while the client no longer owns the clipboard (ie a
VD_AGENT_CLIPBOARD_RELEASE message is in transit to the agent).

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.
2010-10-02 16:29:36 +02:00
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
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
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
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
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
c97116aeb9 Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Alexander Larsson
1f51697852 Rename symbols that were changed in spice-protocol
This is an automatic change using:
$ find -name "*.[ch]" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
$ find -name "*.cpp" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
2010-02-04 18:49:00 +01:00
Yaniv Kamay
8ceb531958 client: add Platform::term_printf
Platform::term_printf is a variant of printf that
on windows dynamically opens console in order to
have visible output during command line processing.
2010-01-11 19:57:29 +02:00
Yaniv Kamay
ad12181027 client: move log file to spicec appdata dir 2010-01-11 19:30:39 +02:00
Yonit Halperin
3eae1c80d9 server,client: server authentication for secured channels.
3 available mechanisms:  by public key, by host name, and by certificate subject name.
In the former method, chain of trust verification is not performed.
The CA certificate files are looked for under <spice-config-dir>/spice_truststore.pem

windows <spice-config-dir>=%APPDATA%\spicec\
linux <spice-config-dir>=$HOME/.spicec/
2010-01-11 19:10:54 +02:00
Arnon Gilboa
6dd05455fb spice: add missing break 2010-01-06 17:26:23 +02:00
Arnon Gilboa
ea9af22e62 spice: position mouse in primary monitor center after full screen toggle
-move _focused & _pointer_in_window from RedWindow to RedWindow_p's
-move shadow focus & cursor handling to sync()
-add reset_cursor_pos() to Platform
-Monitor set_mode()/restore() use virtual do_set_mode()/do_restore()
2009-12-30 22:15:02 +02:00
Yaniv Kamay
68fb440129 client: add GUI infrastructure + functional login dialog 2009-12-28 12:38:58 +02:00
Arnon Gilboa
56eb1acb9e spice: add [pid:tid] to log lines 2009-11-18 13:36:43 +02:00
Arnon Gilboa
8b36ed5460 spice: on toggle_full_screen, generate on_key_down if shift is still pressed 2009-11-18 13:25:06 +02:00
Yonit Halperin
e74de7834d spice client: calling the timers during modal loop in Windows 2009-11-09 22:10:50 +02:00
Yonit Halperin
ec34856fea spice client: remove timer interface from platform - use Application (via ProcessLoop interface). 2009-11-09 19:06:44 +02:00
Yonit Halperin
278c40f301 spice client: cosmetic changes 2009-11-09 17:38:27 +02:00
Yonit Halperin
8d5b738ba1 spice client: creating a general process loop.
The process loop is responsible for: 1) waiting for events 2) timers 3) events queue for
actions that should be performed in the context of the thread and are pushed from other threads.
The benefits:
1) remove duplicity: till now, there was one implementaion of events loop for the channels and
another one for the main thread.
2) timers can be executed on each thread and not only on the main thread.
3) events can be pushed to each thread and not only to the main thread.
In this commit, only the main thread was modified to use the new process loop.
2009-11-09 14:39:33 +02:00
Yaniv Kamay
c1b79eb035 fresh start 2009-10-14 15:06:41 +02:00