/*********************************************************
- * Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* CopyPasteUIX11::GetLocalClipboard --
*
* Retrives the data from local clipboard and sends it to host. Send empty
- * data back if there is no data or can not get data successfully. For
+ * data back if there is no data or can not get data successfully. For
* guest->host copy/paste.
*
* Results:
*
* CopyPasteUIX11::GetCurrentTime --
*
- * Get current time in microseconds.
+ * Get current time in microseconds.
*
* Results:
* Time in microseconds.
__FUNCTION__, target.c_str());
if (target == TARGET_NAME_APPLICATION_RTF ||
- target == TARGET_NAME_TEXT_RICHTEXT) {
+ target == TARGET_NAME_TEXT_RICHTEXT ||
+ target == TARGET_NAME_TEXT_RTF) {
if (0 == mHGRTFData.size()) {
g_debug("%s: Can not get valid RTF data\n", __FUNCTION__);
return;
/* Try to get RTF data from clipboard. */
bool haveRTF = false;
if (refClipboard->wait_is_target_available(TARGET_NAME_APPLICATION_RTF)) {
- g_debug("%s: RTF is available\n", __FUNCTION__);
+ g_debug("%s: APP RTF is available\n", __FUNCTION__);
format = TARGET_NAME_APPLICATION_RTF;
haveRTF = true;
}
format = TARGET_NAME_TEXT_RICHTEXT;
haveRTF = true;
}
+ if (refClipboard->wait_is_target_available(TARGET_NAME_TEXT_RTF)) {
+ g_debug("%s: TEXT_RTF is available\n", __FUNCTION__);
+ format = TARGET_NAME_TEXT_RTF;
+ haveRTF = true;
+ }
if (mCP->CheckCapability(DND_CP_CAP_RTF_CP) && haveRTF) {
/*
if (CPClipboard_GetItem(clip, CPFORMAT_RTF, &buf, &sz)) {
g_debug("%s: RTF data, size %" FMTSZ "u.\n", __FUNCTION__, sz);
Gtk::TargetEntry appRtf(TARGET_NAME_APPLICATION_RTF);
- Gtk::TargetEntry textRtf(TARGET_NAME_TEXT_RICHTEXT);
+ Gtk::TargetEntry textRichText(TARGET_NAME_TEXT_RICHTEXT);
+ Gtk::TargetEntry textRtf(TARGET_NAME_TEXT_RTF);
targets.push_back(appRtf);
+ targets.push_back(textRichText);
targets.push_back(textRtf);
mHGRTFData = std::string((const char *)buf);
mIsClipboardOwner = true;
/*********************************************************
- * Copyright (C) 2005-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2005-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#define TARGET_NAME_COMPOUND_TEXT "COMPOUND_TEXT"
#define TARGET_NAME_APPLICATION_RTF "application/rtf"
#define TARGET_NAME_TEXT_RICHTEXT "text/richtext"
+#define TARGET_NAME_TEXT_RTF "text/rtf"
#define DRAG_TARGET_NAME_URI_LIST "text/uri-list"
#define DRAG_LEAVE_TIMEOUT 500
/*********************************************************
- * Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
/* RTF text DnD. */
targets.push_back(Gtk::TargetEntry(TARGET_NAME_APPLICATION_RTF));
targets.push_back(Gtk::TargetEntry(TARGET_NAME_TEXT_RICHTEXT));
+ targets.push_back(Gtk::TargetEntry(TARGET_NAME_TEXT_RTF));
/* Plain text DnD. */
targets.push_back(Gtk::TargetEntry(TARGET_NAME_UTF8_STRING));
if (CPClipboard_ItemExists(&mClipboard, CPFORMAT_RTF)) {
targets->add(Glib::ustring(TARGET_NAME_APPLICATION_RTF));
targets->add(Glib::ustring(TARGET_NAME_TEXT_RICHTEXT));
+ targets->add(Glib::ustring(TARGET_NAME_TEXT_RTF));
}
actions = Gdk::ACTION_COPY | Gdk::ACTION_MOVE;
/* Then check RTF. */
targets->add(Glib::ustring(TARGET_NAME_APPLICATION_RTF));
targets->add(Glib::ustring(TARGET_NAME_TEXT_RICHTEXT));
+ targets->add(Glib::ustring(TARGET_NAME_TEXT_RTF));
target = mDetWnd->drag_dest_find_target(dc, targets);
targets->remove(Glib::ustring(TARGET_NAME_APPLICATION_RTF));
targets->remove(Glib::ustring(TARGET_NAME_TEXT_RICHTEXT));
+ targets->remove(Glib::ustring(TARGET_NAME_TEXT_RTF));
if (target != "") {
mDetWnd->drag_get_data(dc, target, time);
mNumPendingRequest++;
/*********************************************************
- * Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
static inline bool TargetIsRichText(const utf::string& target) {
return target == TARGET_NAME_APPLICATION_RTF
- || target == TARGET_NAME_TEXT_RICHTEXT;
+ || target == TARGET_NAME_TEXT_RICHTEXT
+ || target == TARGET_NAME_TEXT_RTF;
}
void OnWorkAreaChanged(Glib::RefPtr<Gdk::Screen> screen);