summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2010-10-06 16:00:39 +0200
committerArnon Gilboa <agilboa@agilboa.usersys.redhat.com>2010-10-11 17:29:43 +0200
commitf2ef521740d3b5a0bdc03408dc1648197c919f83 (patch)
tree0b23ccd652b939d392e374fed86b3ff1bfe9e469
parent26814c4f9ca492bab8f11145a4a50cb63c695a7a (diff)
downloadspice-f2ef521740d3b5a0bdc03408dc1648197c919f83.tar.gz
spice-f2ef521740d3b5a0bdc03408dc1648197c919f83.tar.xz
spice-f2ef521740d3b5a0bdc03408dc1648197c919f83.zip
spice-win: handle type VD_AGENT_CLIPBOARD_NONE in Platform::on_clipboard_notify()
-rw-r--r--client/windows/platform.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp
index c8750222..4df7d435 100644
--- a/client/windows/platform.cpp
+++ b/client/windows/platform.cpp
@@ -105,6 +105,7 @@ static uint32_t get_clipboard_format(uint32_t type) {
return iter->format;
}
+//FIXME: handle multiple types
static uint32_t get_available_clipboard_type()
{
uint32_t type = 0;
@@ -149,6 +150,7 @@ static LRESULT CALLBACK PlatformWinProc(HWND hWnd, UINT message, WPARAM wParam,
break;
case WM_DRAWCLIPBOARD:
if (!clipboard_changer) {
+ //FIXME: handle multiple types
uint32_t type = get_available_clipboard_type();
if (type) {
clipboard_listener->on_clipboard_grab(&type, 1);
@@ -865,12 +867,15 @@ void Platform::set_clipboard_owner_unlocked(int new_owner)
void Platform::set_clipboard_owner(int new_owner)
{
+ const char * const owner_str[] = { "none", "guest", "client" };
+
if (new_owner == owner_none) {
clipboard_listener->on_clipboard_release();
/* FIXME clear cached clipboard type info and data */
}
_clipboard_owner = new_owner;
+ LOG_INFO("new clipboard owner: %s", owner_str[new_owner]);
}
bool Platform::on_clipboard_grab(uint32_t *types, uint32_t type_count)
@@ -908,6 +913,10 @@ bool Platform::on_clipboard_notify(uint32_t type, const uint8_t* data, int32_t s
UINT format;
bool ret = false;
+ if (type == VD_AGENT_CLIPBOARD_NONE) {
+ SetEvent(clipboard_event);
+ return true;
+ }
// Get the required clipboard size
switch (type) {
case VD_AGENT_CLIPBOARD_UTF8_TEXT:
@@ -920,7 +929,7 @@ bool Platform::on_clipboard_notify(uint32_t type, const uint8_t* data, int32_t s
break;
default:
LOG_INFO("Unsupported clipboard type %u", type);
- return false;
+ return true;
}
// Allocate and lock clipboard memory