#include "vm_version.h"
-#define COPYRIGHT_YEARS "1998-2010"
+#define COPYRIGHT_YEARS "1998-2011"
#define COPYRIGHT_STRING "Copyright \251 " COPYRIGHT_YEARS " " COMPANY_NAME
#define UTF8_COPYRIGHT_STRING "Copyright \302\251 " COPYRIGHT_YEARS " " COMPANY_NAME
#define GENERIC_COPYRIGHT_STRING "Copyright (C) " COPYRIGHT_YEARS " " COMPANY_NAME
DND_CMD_SEND_FILES_DONE,
DND_CMD_QUERY_EXITING,
DND_CMD_DRAG_NOT_PENDING,
- DND_CMD_UPDATE_UNITY_DET_WND
+ DND_CMD_UPDATE_UNITY_DET_WND,
+ DND_CMD_DEST_CANCEL
} DnDCmdV4;
/* Copy/Paste commands. */
virtual bool SrcPrivDragEnter(uint32 sessionId) = 0;
virtual bool SrcPrivDragLeave(uint32 sessionId, int32 x, int32 y) = 0;
virtual bool SrcPrivDrop(uint32 sessionId, int32 x, int32 y) = 0;
+ virtual bool SrcCancel(uint32 sessionId) = 0;
/* DnD destination. */
virtual bool DestDragEnter(uint32 sessionId,
const CPClipboard *clip) = 0;
virtual bool DestDragLeave(uint32 sessionId, int32 x, int32 y) = 0;
virtual bool DestDrop(uint32 sessionId, int32 x, int32 y) = 0;
+ virtual bool DestCancel(uint32 sessionId) = 0;
/* Common. */
virtual void Init(void) = 0;
virtual bool SrcPrivDragEnter(uint32 sessionId);
virtual bool SrcPrivDragLeave(uint32 sessionId, int32 x, int32 y);
virtual bool SrcPrivDrop(uint32 sessionId, int32 x, int32 y);
+ virtual bool SrcCancel(uint32 sessionId);
/* DnD destination. */
virtual bool DestDragEnter(uint32 sessionId,
virtual bool DestDrop(uint32 sessionId,
int32 x,
int32 y);
+ virtual bool DestCancel(uint32 sessionId);
/* Common. */
virtual bool UpdateFeedback(uint32 sessionId, DND_DROPEFFECT feedback);
virtual bool SrcPrivDragEnter(uint32 sessionId);
virtual bool SrcPrivDragLeave(uint32 sessionId, int32 x, int32 y);
virtual bool SrcPrivDrop(uint32 sessionId, int32 x, int32 y);
+ virtual bool SrcCancel(uint32 sessionId) { return true; };
/* DnD destination. */
virtual bool DestDragEnter(uint32 sessionId,
virtual bool DestDrop(uint32 sessionId,
int32 x,
int32 y);
+ virtual bool DestCancel(uint32 sessionId) { return true; };
/* Common. */
virtual bool UpdateFeedback(uint32 sessionId, DND_DROPEFFECT feedback);
}
+/**
+ * Send cmd DND_CMD_SRC_CANCEL to controller.
+ *
+ * @param[in] sessionId active session id the controller assigned earlier.
+ *
+ * @return true on success, false otherwise.
+ */
+
+bool
+DnDRpcV4::SrcCancel(uint32 sessionId)
+{
+ RpcParams params;
+
+ memset(¶ms, 0, sizeof params);
+ params.addrId = DEFAULT_CONNECTION_ID;
+ params.cmd = DND_CMD_SRC_CANCEL;
+ params.sessionId = sessionId;
+
+ return mUtil.SendMsg(¶ms);
+}
+
+
/**
* Send cmd DND_CMD_DEST_DRAG_ENTER to controller.
*
}
+/**
+ * Send cmd DND_CMD_DEST_CANCEL to controller.
+ *
+ * @param[in] sessionId active session id the controller assigned earlier.
+ *
+ * @return true on success, false otherwise.
+ */
+
+bool
+DnDRpcV4::DestCancel(uint32 sessionId)
+{
+ RpcParams params;
+
+ memset(¶ms, 0, sizeof params);
+ params.addrId = DEFAULT_CONNECTION_ID;
+ params.cmd = DND_CMD_DEST_CANCEL;
+ params.sessionId = sessionId;
+
+ return mUtil.SendMsg(¶ms);
+}
+
+
/**
* Send cmd DND_CMD_QUERY_EXITING to controller.
*
params->optional.mouseInfo.x,
params->optional.mouseInfo.y);
break;
+ case DND_CMD_DEST_CANCEL:
+ destCancelChanged.emit(params->sessionId);
+ break;
case DND_CMD_PRIV_DRAG_ENTER:
destPrivDragEnterChanged.emit(params->sessionId);
break;
m_unityMode(false),
m_inHGDrag(false),
m_effect(DROP_NONE),
- m_isFileDnD(false),
+ m_fileTransferStarted(false),
m_mousePosX(0),
m_mousePosY(0),
m_dc(NULL),
m_effect = DROP_NONE;
m_inHGDrag = false;
m_dc = NULL;
- m_isFileDnD = false;
+ m_fileTransferStarted = false;
RemoveBlock();
}
/* Tell Gtk that a drag should be started from this widget. */
m_detWnd->drag_begin(targets, actions, 1, (GdkEvent *)&event);
m_blockAdded = false;
- m_isFileDnD = false;
+ m_fileTransferStarted = false;
SourceDragStartDone();
/* Initialize host hide feedback to DROP_NONE. */
m_effect = DROP_NONE;
* call CommonResetCB(). Otherwise destination may miss the data because
* we are already reset.
*/
+
+ m_HGGetDataInProgress = false;
+
if (!m_inHGDrag) {
CommonResetCB();
} else {
RemoveBlock();
}
- m_HGGetDataInProgress = false;
}
* Doing both of these addresses bug
* http://bugzilla.eng.vmware.com/show_bug.cgi?id=391661.
*/
- if (!m_blockAdded && m_inHGDrag) {
+ if (!m_blockAdded && m_inHGDrag && !m_fileTransferStarted) {
m_HGGetDataInProgress = true;
- m_isFileDnD = true;
+ m_fileTransferStarted = true;
AddBlock();
} else {
g_debug("%s: not calling AddBlock\n", __FUNCTION__);
* CommonResetCB() here, since we will do so in the fileCopyDoneChanged
* callback.
*/
- if (!m_isFileDnD || !m_HGGetDataInProgress) {
+ if (!m_fileTransferStarted || !m_HGGetDataInProgress) {
CommonResetCB();
}
m_inHGDrag = false;
bool m_unityMode;
bool m_inHGDrag;
DND_DROPEFFECT m_effect;
- bool m_isFileDnD;
+ bool m_fileTransferStarted;
int32 m_mousePosX;
int32 m_mousePosY;
GdkDragContext *m_dc;