~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to vmware-user/copyPaste.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-10-23 15:32:00 UTC
  • mfrom: (1.1.2 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081023153200-gc1bfx89hj35c799
Tags: 2008.10.10-123053-2
* Correcting typo in dh_installinit call.
* Downgrading depends on module-assistant to recommends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
#include "file.h"
80
80
#include "codeset.h"
81
81
#include "escape.h"
 
82
#include "hostinfo.h"
 
83
#include "wiper.h"
82
84
 
83
85
 
84
86
/*
97
99
GdkAtom GDK_SELECTION_TYPE_UTF8_STRING;
98
100
#endif
99
101
 
100
 
/* FCP target used in gnome. */
101
 
#define FCP_TARGET_NAME_GNOME_COPIED_FILES   "x-special/gnome-copied-files"
102
 
#define FCP_TARGET_INFO_GNOME_COPIED_FILES   0
103
 
/* FCP target used in KDE. */
104
 
#define FCP_TARGET_NAME_URI_LIST             "text/uri-list"
105
 
#define FCP_TARGET_INFO_URI_LIST             1
106
 
/* Number of FCP targets. */
107
 
#define NR_FCP_TARGETS                       2
108
 
 
109
102
typedef struct FCPGHState {
110
103
   char *fileList;
111
104
   char *fileListNext;
158
151
static char gFileRoot[DND_MAX_PATH];
159
152
static size_t gFileRootSize;
160
153
static Bool gIsOwner;
 
154
static VmTimeType gHGGetListTime;
161
155
 
162
156
/*
163
157
 * Forward Declarations
510
504
   size_t textLen = 1;
511
505
   Bool blockAdded = FALSE;
512
506
   Bool gnomeFCP = FALSE;
 
507
   VmTimeType curTime;
513
508
 
514
509
   if ((widget == NULL) || (selection_data == NULL)) {
515
510
      Debug("CopyPasteSelectionGetCB: Error, widget or selection_data is invalid\n");
557
552
      return;
558
553
   }
559
554
 
 
555
   /*
 
556
    * KDE may ask for clipboard content right after clipboard owner changed,
 
557
    * and cause unexpected HG file copy. So HG FCP will return nothing for 1
 
558
    * second after switch from host OS to guest OS. Please refer to bug 301971.
 
559
    */
 
560
   Hostinfo_GetTimeOfDay(&curTime);
 
561
   if (curTime - gHGGetListTime < FCP_COPY_DELAY) {
 
562
      Debug("%s: waiting for delay\n", __FUNCTION__);
 
563
      return;
 
564
   }
 
565
 
560
566
   if (gHGFCPFileTransferStatus == FCP_FILE_TRANSFER_NOT_YET) {
561
 
      if (GetAvailableDiskSpace(gFileRoot) < gHGFCPTotalSize) {
 
567
      if (GuestInfo_GetAvailableDiskSpace(gFileRoot) < gHGFCPTotalSize) {
562
568
         Debug("CopyPasteSelectionGetCB no enough space to copy file from host.\n");
563
569
         return;
564
570
      }
1614
1620
   free(sTotalSize);
1615
1621
   free(sListSize);
1616
1622
   free(stagingDirName);
 
1623
   Hostinfo_GetTimeOfDay(&gHGGetListTime);
1617
1624
   return RpcIn_SetRetVals(result, resultLen, retStr, ret);
1618
1625
}
1619
1626
 
1918
1925
                          CopyPasteRpcInGHFinishCB, NULL);
1919
1926
 
1920
1927
   CopyPasteStateInit();
 
1928
   Wiper_Init(NULL);
1921
1929
 
1922
1930
   return CopyPaste_RegisterCapability();
1923
1931
}