summaryrefslogtreecommitdiffstats
path: root/client/x11
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-10-01 20:01:47 +0200
committerHans de Goede <hdegoede@redhat.com>2010-10-01 20:01:47 +0200
commita2d645ffe3fa23e8c57950987c93c0fe8822238b (patch)
tree76621a76bdc10c4dd86c91300c98870859ada29a /client/x11
parentc6e9c52a2a588fa11f516e96f3ba5fea3cd67274 (diff)
downloadspice-a2d645ffe3fa23e8c57950987c93c0fe8822238b.tar.gz
spice-a2d645ffe3fa23e8c57950987c93c0fe8822238b.tar.xz
spice-a2d645ffe3fa23e8c57950987c93c0fe8822238b.zip
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.
Diffstat (limited to 'client/x11')
-rw-r--r--client/x11/platform.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 8f4ed2de..66271872 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -151,7 +151,7 @@ static Platform::DisplayModeListener* display_mode_listener = &default_display_m
class DefaultClipboardListener: public Platform::ClipboardListener {
public:
- void on_clipboard_grab(uint32_t type) {}
+ void on_clipboard_grab(uint32_t *types, uint32_t type_count) {}
void on_clipboard_request(uint32_t type) {}
void on_clipboard_notify(uint32_t type, uint8_t* data, int32_t size) {}
};
@@ -2392,7 +2392,8 @@ static void root_win_proc(XEvent& event)
return;
}
// FIXME: use actual type
- clipboard_listener->on_clipboard_grab(VD_AGENT_CLIPBOARD_UTF8_TEXT);
+ uint32_t type = VD_AGENT_CLIPBOARD_UTF8_TEXT;
+ clipboard_listener->on_clipboard_grab(&type, 1);
return;
}
switch (event.type) {
@@ -3144,13 +3145,14 @@ LocalCursor* Platform::create_default_cursor()
return new XDefaultCursor();
}
-bool Platform::set_clipboard_owner(uint32_t type)
+bool Platform::set_clipboard_owner(uint32_t *types, uint32_t type_count)
{
Lock lock(clipboard_lock);
- uint32_t format = get_clipboard_format(type);
+ /* FIXME use all types rather then just the first one */
+ uint32_t format = get_clipboard_format(types[0]);
if (!format) {
- LOG_INFO("Unsupported clipboard type %u", type);
+ LOG_INFO("Unsupported clipboard type %u", types[0]);
return false;
}
clipboard_changer = true;