summaryrefslogtreecommitdiffstats
path: root/client/windows/platform.cpp
Commit message (Collapse)AuthorAgeFilesLines
* client/windows: fix SetClipboardViewer error handling rhbz#786554Arnon Gilboa2012-03-011-3/+4
| | | | | | | | | | | | | | | MSDN says the following about SetClipboardViewer(): "If an error occurs or there are no other windows in the clipboard viewer chain, the return value is NULL". Seems like the buggy case was "no other windows in the clipboard viewer chain", which explains the 3rd party clipboard manager workaround detailed in the bug description. It also seems like SetClipboardViewer() does not clear the error state on succcess. Calling SetLastError(0) before SetClipboardViewer() seems to solves this issue. Since we could not reproduce the bug on our env, the customer has verified on several of their systems that a private build resolved the issue.
* Remove trailing whitespace from end of linesDaniel P. Berrange2012-01-131-5/+5
|
* client: fix for redundant shift+f11 RHBZ #674532Yonit Halperin2011-06-141-10/+19
| | | | | | | | | | | 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.
* common: add windows.h where required, make gdi_handlers staticMarc-André Lureau2011-05-031-1/+0
| | | | | This patch has not been verified with VS/brew. It should be safe hopefully. Compilation is fine with mingw32/spice-gtk.
* add #include <config.h> to all source filesChristophe Fergeau2011-05-031-0/+3
| | | | | | | | 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
* client/windows: don't allocate console unless requiredAlon Levy2011-01-271-9/+27
|
* mingw32 build: check for CXImage, disable if not found (only on mingw32)Alon Levy2010-12-081-0/+15
| | | | | | v2: + simplify (Hans) + also report presence of cximage for mingw32 target
* mingw32 build: eol fixesAlon Levy2010-12-081-11/+11
|
* mingw32 build: remove unused, initialize uninitialized, reorder constructor ↵Alon Levy2010-12-081-4/+4
| | | | initializers
* mingw32 build: fix assignement as condition warningAlon Levy2010-12-081-1/+1
|
* mingw32 build: fix signed/unsigned warnings as errorsAlon Levy2010-12-081-6/+6
|
* spicec-win: add image copy-paste supportArnon Gilboa2010-11-241-61/+143
| | | | | | -currently png & bmp -using wspice libs cximage.lib & png.lib -jpg & tiff will follow
* spice-win: handle multiple types on clipboard grab send & receiveArnon Gilboa2010-10-111-19/+36
|
* spice-win: remove clipboard_changer hackArnon Gilboa2010-10-111-9/+2
| | | | Instead of keeping a flag, we simply check wether the new owner is us or not
* spice-win: handle type VD_AGENT_CLIPBOARD_NONE in ↵Arnon Gilboa2010-10-111-1/+10
| | | | Platform::on_clipboard_notify()
* spice-win: remove windows-specific bitmap cut & paste supportArnon Gilboa2010-10-111-17/+0
| | | | will wait until png comes in
* spicec: Move setting of clipboard_owner to guest to platform codeHans de Goede2010-10-061-0/+7
| | | | | | | | | | | | | | 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.
* spicec-x11: Force processing of ownerchange event when releasing the cbHans de Goede2010-10-041-0/+1
| | | | | | | | | | | | 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.
* Keep track of clipboard ownershipHans de Goede2010-10-021-0/+13
| | | | | | | | | | | | | 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.
* Rename platform clipboard handling functionsHans de Goede2010-10-021-4/+4
| | | | | | | | | | 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.
* Change VD_AGENT_CLIPBOARD_GRAB to an array of typesHans de Goede2010-10-011-5/+6
| | | | | | | 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.
* client: support clipboard/selection-owner model (v2)Arnon Gilboa2010-10-011-52/+212
| | | | | | | | | | | | | | | | | | | | | | | | | -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
* client: add clipboard supportArnon Gilboa2010-07-191-0/+90
| | | | | | | | * 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
* fix typo DisplayModeListner -> DisplayModeListenerAlon Levy2010-07-191-1/+1
|
* Replace log4cpp with custom log functionAlexander Larsson2010-06-281-0/+1
| | | | | Also prints a simpler error to stderr for WARN or above so that we print something on the commandline if something go wrong.
* Relicense everything from GPL to LGPL 2.1+Alexander Larsson2010-04-131-9/+9
|
* Rename symbols that were changed in spice-protocolAlexander Larsson2010-02-041-16/+16
| | | | | | 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
* client: add Platform::term_printfYaniv Kamay2010-01-111-0/+64
| | | | | | Platform::term_printf is a variant of printf that on windows dynamically opens console in order to have visible output during command line processing.
* client: move log file to spicec appdata dirYaniv Kamay2010-01-111-6/+11
|
* server,client: server authentication for secured channels.Yonit Halperin2010-01-111-0/+19
| | | | | | | | | 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/
* spice: add missing breakArnon Gilboa2010-01-061-0/+1
|
* spice: position mouse in primary monitor center after full screen toggleArnon Gilboa2009-12-301-8/+25
| | | | | | | -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()
* client: add GUI infrastructure + functional login dialogYaniv Kamay2009-12-281-0/+5
|
* spice: add [pid:tid] to log linesArnon Gilboa2009-11-181-0/+11
|
* spice: on toggle_full_screen, generate on_key_down if shift is still pressedArnon Gilboa2009-11-181-2/+19
|
* spice client: calling the timers during modal loop in WindowsYonit Halperin2009-11-091-0/+52
|
* spice client: remove timer interface from platform - use Application (via ↵Yonit Halperin2009-11-091-35/+0
| | | | ProcessLoop interface).
* spice client: cosmetic changesYonit Halperin2009-11-091-1/+1
|
* spice client: creating a general process loop.Yonit Halperin2009-11-091-179/+48
| | | | | | | | | | | 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.
* fresh startYaniv Kamay2009-10-141-0/+786