]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Tue, 26 Apr 2011 20:21:59 +0000 (13:21 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 26 Apr 2011 20:21:59 +0000 (13:21 -0700)
. DnD: don't reset state of active file trasfers, so that DnD works even
  when snapshots are taken.

. changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/vm_version.h
open-vm-tools/services/plugins/dndcp/copyPasteDnDWrapper.cpp
open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp
open-vm-tools/services/plugins/dndcp/dndUIX11.cpp

index ca02a3971e5ff536b7349fb1d55bb3bf74f6a3a2..a2a89b9179a671b802c3b71e3b2c0d6ae7db1813 100644 (file)
 #define PRODUCT_VERSION_SCALABLE_SERVER_30 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 3.0"
 #define PRODUCT_VERSION_SCALABLE_SERVER_31 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 3.5"
 #define PRODUCT_VERSION_SCALABLE_SERVER_40 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 4.x"
+#define PRODUCT_VERSION_SCALABLE_SERVER_5 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 5.x"
 #define PRODUCT_VERSION_WGS_1 PRODUCT_WGS_BRIEF_NAME " 1.x"
 #define PRODUCT_VERSION_WGS_2 PRODUCT_WGS_BRIEF_NAME " 2.x"
 #define PRODUCT_VERSION_GSX_2 PRODUCT_GSX_BRIEF_NAME " 2.x"
 #define PRODUCT_VERSION_WORKSTATION_6 PRODUCT_WORKSTATION_BRIEF_NAME " 6.0"
 #define PRODUCT_VERSION_WORKSTATION_65 PRODUCT_WORKSTATION_BRIEF_NAME " 6.5"
 #define PRODUCT_VERSION_WORKSTATION_7 PRODUCT_WORKSTATION_BRIEF_NAME " 7.x"
-#define PRODUCT_VERSION_WORKSTATION_80 PRODUCT_WORKSTATION_BRIEF_NAME " 8.0"
+#define PRODUCT_VERSION_WORKSTATION_8 PRODUCT_WORKSTATION_BRIEF_NAME " 8.x"
 #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_1 "ACE 1.x"
 #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_2 "ACE 2.0"
 #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_25 "ACE 2.5"
 #define PRODUCT_VERSION_MAC_DESKTOP_1 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 1.1"
 #define PRODUCT_VERSION_MAC_DESKTOP_2 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 2.x"
 #define PRODUCT_VERSION_MAC_DESKTOP_3 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 3.x"
+#define PRODUCT_VERSION_MAC_DESKTOP_4 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 4.x"
 
 
 /*
index d2f81d23c07fea17f7ca3d4b48d2f2b265f6bc72..1cc5390759e99a6d8529daa3e9d90f19c6987eb8 100644 (file)
@@ -480,6 +480,23 @@ void
 CopyPasteDnDWrapper::OnResetInternal()
 {
    g_debug("%s: enter\n", __FUNCTION__);
+
+   /*
+    * Reset DnD/Copy/Paste only if vmx said we can. The reason is that
+    * we may also get reset request from vmx when user is taking snapshot
+    * or recording. If there is an ongoing DnD/copy/paste, we should not
+    * reset here. For details please refer to bug 375928.
+    */
+   char *reply = NULL;
+   size_t replyLen;
+   ToolsAppCtx *ctx = GetToolsAppCtx();
+   if (RpcChannel_Send(ctx->rpc, "dnd.is.active",
+                       strlen("dnd.is.active"), &reply, &replyLen) &&
+       (1 == atoi(reply))) {
+      g_debug("%s: ignore reset while file transfer is busy.\n", __FUNCTION__);
+      return;
+   }
+
    if (IsDnDRegistered()) {
       UnregisterDnD();
    }
@@ -490,21 +507,7 @@ CopyPasteDnDWrapper::OnResetInternal()
       RegisterCP();
    }
    if (IsDnDEnabled() && !IsDnDRegistered()) {
-      /*
-       * Reset DnD/Copy/Paste only if vmx said we can. The reason is that
-       * we may also get reset request from vmx when user is taking snapshot
-       * or recording. If there is an ongoing DnD/copy/paste, we should not
-       * reset here. For details please refer to bug 375928.
-       */
-
-      char *reply = NULL;
-      size_t replyLen;
-      ToolsAppCtx *ctx = GetToolsAppCtx();
-      if (!RpcChannel_Send(ctx->rpc, "dnd.is.active",
-                           strlen("dnd.is.active"), &reply, &replyLen) ||
-          (0 == atoi(reply))) {
-         RegisterDnD();
-      }
+      RegisterDnD();
    }
    if (!IsDnDRegistered() || !IsCPRegistered()) {
       g_debug("%s: unable to reset fully DnD %d CP %d!\n",
index 2226b5519e4c9c0a6f75c865275840888f20aa79..9279da7e3d8b0221a39bce0004cf68ae08682c9e 100644 (file)
@@ -168,6 +168,14 @@ CopyPasteUIX11::~CopyPasteUIX11()
 {
    g_debug("%s: enter\n", __FUNCTION__);
    CPClipboard_Destroy(&mClipboard);
+   if (mBlockAdded) {
+      g_debug("%s: removing block for %s\n", __FUNCTION__, mHGStagingDir.c_str());
+      /* We need to make sure block subsystem has not been shut off. */
+      if (DnD_BlockIsReady(mBlockCtrl)) {
+         mBlockCtrl->RemoveBlock(mBlockCtrl->fd, mHGStagingDir.c_str());
+      }
+      mBlockAdded = false;
+   }
 }
 
 
index cfd985ec0b6592a898409db585c01e79dc4325b2..03ca3eaee86fcf4a6e3169b0e5a581f062a9b4ad 100644 (file)
@@ -94,6 +94,7 @@ DnDUIX11::~DnDUIX11()
       delete m_detWnd;
    }
    CPClipboard_Destroy(&m_clipboard);
+   CommonResetCB();
 }