mirror of
https://github.com/sheumann/VNCviewGS.git
synced 2024-12-26 03:29:21 +00:00
Don't block waiting for large clipboard transfers.
This commit is contained in:
parent
f4c403d8d8
commit
a6a34dd080
19
clipboard.cc
19
clipboard.cc
@ -77,12 +77,11 @@ static unsigned char windows1252ToMacRoman[128] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static unsigned long textLen;
|
||||||
|
|
||||||
/* Update the Scrap Manager clipboard with new data sent from server.
|
/* Update the Scrap Manager clipboard with new data sent from server.
|
||||||
*/
|
*/
|
||||||
void DoServerCutText (void) {
|
void DoServerCutText (void) {
|
||||||
unsigned long textLen;
|
|
||||||
unsigned long i;
|
|
||||||
|
|
||||||
if (! DoWaitingReadTCP (3)) { /* Read & ignore padding */
|
if (! DoWaitingReadTCP (3)) { /* Read & ignore padding */
|
||||||
DoClose(vncWindow);
|
DoClose(vncWindow);
|
||||||
return;
|
return;
|
||||||
@ -92,9 +91,17 @@ void DoServerCutText (void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
textLen = SwapBytes4(*(unsigned long *)readBufferPtr);
|
textLen = SwapBytes4(*(unsigned long *)readBufferPtr);
|
||||||
|
|
||||||
|
/* Set up to wait for clipboard data. Treat this like a
|
||||||
|
* "display in progress," although it's really not. */
|
||||||
|
displayInProgress = TRUE;
|
||||||
|
GetClipboard();
|
||||||
|
}
|
||||||
|
|
||||||
if (! DoWaitingReadTCP(textLen)) {
|
void GetClipboard (void) {
|
||||||
DoClose(vncWindow);
|
unsigned long i;
|
||||||
|
|
||||||
|
if (! DoReadTCP(textLen)) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
if (allowClipboardTransfers) {
|
if (allowClipboardTransfers) {
|
||||||
@ -116,6 +123,8 @@ void DoServerCutText (void) {
|
|||||||
/* Potential errors (e.g. out of memory) ignored */
|
/* Potential errors (e.g. out of memory) ignored */
|
||||||
DoneWithReadBuffer();
|
DoneWithReadBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
displayInProgress = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoSendClipboard (void) {
|
void DoSendClipboard (void) {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
extern void DoServerCutText (void);
|
extern void DoServerCutText (void);
|
||||||
|
extern void GetClipboard (void);
|
||||||
extern void DoSendClipboard (void);
|
extern void DoSendClipboard (void);
|
||||||
|
|
||||||
|
extern int waitingForClipboard;
|
||||||
|
@ -316,6 +316,8 @@ void ConnectedEventLoop (void) {
|
|||||||
return;
|
return;
|
||||||
case encodingHextile: HexDispatch();
|
case encodingHextile: HexDispatch();
|
||||||
return;
|
return;
|
||||||
|
case nonEncodingClipboard: GetClipboard();
|
||||||
|
return;
|
||||||
default: DoClose(vncWindow);
|
default: DoClose(vncWindow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -353,7 +355,8 @@ void ConnectedEventLoop (void) {
|
|||||||
break;
|
break;
|
||||||
case Bell: SysBeep();
|
case Bell: SysBeep();
|
||||||
break;
|
break;
|
||||||
case ServerCutText: DoServerCutText();
|
case ServerCutText: rectEncoding = nonEncodingClipboard;
|
||||||
|
DoServerCutText();
|
||||||
break;
|
break;
|
||||||
default: DisplayConnectStatus (
|
default: DisplayConnectStatus (
|
||||||
"\pInvalid message from server.",
|
"\pInvalid message from server.",
|
||||||
|
@ -18,10 +18,16 @@ extern unsigned int rectHeight;
|
|||||||
#define encodingRRE 2
|
#define encodingRRE 2
|
||||||
#define encodingCoRRE 4
|
#define encodingCoRRE 4
|
||||||
#define encodingHextile 5
|
#define encodingHextile 5
|
||||||
|
#define encodingZlib 6
|
||||||
|
#define encodingTight 7
|
||||||
|
#define encodingZlibhex 8
|
||||||
|
#define encodingTRLE 15
|
||||||
#define encodingZRLE 16
|
#define encodingZRLE 16
|
||||||
#define encodingCursor 0xffffff11
|
#define encodingCursor 0xffffff11
|
||||||
#define encodingDesktopSize 0xffffff21
|
#define encodingDesktopSize 0xffffff21
|
||||||
|
|
||||||
|
#define nonEncodingClipboard 3 /* should be different from any encoding */
|
||||||
|
|
||||||
#define WIN_WIDTH_320 302
|
#define WIN_WIDTH_320 302
|
||||||
#define WIN_WIDTH_640 613
|
#define WIN_WIDTH_640 613
|
||||||
#define WIN_HEIGHT 174
|
#define WIN_HEIGHT 174
|
||||||
|
Loading…
Reference in New Issue
Block a user