mBlockAdded(false),
mBlockCtrl(0),
mInited(false),
- mTotalFileSize(0)
+ mTotalFileSize(0),
+ mGetTimestampOnly(false)
{
GuestDnDCPMgr *p = GuestDnDCPMgr::GetInstance();
ASSERT(p);
mClipTime = 0;
mPrimTime = 0;
mGHSelection = GDK_SELECTION_CLIPBOARD;
+ mGetTimestampOnly = false;
g_debug("%s: retrieving timestamps\n", __FUNCTION__);
refClipboard->request_contents(TARGET_NAME_TIMESTAMP,
sigc::mem_fun(this, &CopyPasteUIX11::LocalClipboardTimestampCB));
g_debug("%s: Unable to get mPrimTime.", __FUNCTION__);
}
+ if (mGetTimestampOnly) {
+ mLastTimestamp = mClipTime > mPrimTime ? mClipTime : mPrimTime;
+ return;
+ }
+
/* After got both timestamp, choose latest one as active selection. */
if (mClipTime > mPrimTime) {
mGHSelection = GDK_SELECTION_CLIPBOARD;
refClipboard->set_image(loader->get_pixbuf());
refPrimary->set_image(loader->get_pixbuf());
+
+ /*
+ * Record current clipboard timestamp to prevent unexpected clipboard
+ * exchange.
+ *
+ * XXX We should do this for all formats.
+ */
+ mClipTime = 0;
+ mPrimTime = 0;
+ mGetTimestampOnly = true;
+ refClipboard->request_contents(TARGET_NAME_TIMESTAMP,
+ sigc::mem_fun(this, &CopyPasteUIX11::LocalClipboardTimestampCB));
} catch(...) {
// Do nothing
}