|
|
@@ -215,6 +215,8 @@ __fastcall TCustomScpExplorerForm::TCustomScpExplorerForm(TComponent* Owner):
|
|
|
FIncrementalSearching = 0;
|
|
|
FIncrementalSearchHaveNext = false;
|
|
|
FQueueFileList.reset(new TQueueFileList());
|
|
|
+ FDownloadingFromClipboard = false;
|
|
|
+ FClipboardFakeMonitorsPendingReset = false;
|
|
|
|
|
|
FEditorManager = new TEditorManager();
|
|
|
FEditorManager->OnFileChange = ExecutedFileChanged;
|
|
|
@@ -4680,6 +4682,12 @@ void __fastcall TCustomScpExplorerForm::Idle()
|
|
|
UpdateStatusBar();
|
|
|
}
|
|
|
|
|
|
+ if (FClipboardFakeMonitorsPendingReset && !FDownloadingFromClipboard)
|
|
|
+ {
|
|
|
+ FClipboardFakeMonitorsPendingReset = false;
|
|
|
+ FClipboardFakeMonitors.reset(NULL);
|
|
|
+ }
|
|
|
+
|
|
|
FIgnoreNextDialogChar = 0;
|
|
|
|
|
|
}
|
|
|
@@ -10620,8 +10628,15 @@ void __fastcall TCustomScpExplorerForm::ClipboardStop()
|
|
|
RemoveDir(ApiPath(FClipboardFakeDirectory));
|
|
|
FClipboardFakeDirectory = UnicodeString();
|
|
|
FClipboardTerminal = NULL;
|
|
|
- // Also called in Idle()
|
|
|
- FClipboardFakeMonitors.reset(NULL);
|
|
|
+ if (FDownloadingFromClipboard)
|
|
|
+ {
|
|
|
+ // We are called by the monitor, so attempt to release it would deadlonk
|
|
|
+ FClipboardFakeMonitorsPendingReset = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ FClipboardFakeMonitors.reset(NULL);
|
|
|
+ }
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
void __fastcall TCustomScpExplorerForm::ClipboardDataObjectRelease(TObject * /*Sender*/)
|
|
|
@@ -10657,7 +10672,10 @@ void __fastcall TCustomScpExplorerForm::ClipboardFakeCreated(TObject * /*Sender*
|
|
|
{
|
|
|
if (!NonVisualDataModule->Busy)
|
|
|
{
|
|
|
+ DebugAssert(!FClipboardFakeMonitorsPendingReset);
|
|
|
+ FClipboardFakeMonitorsPendingReset = false;
|
|
|
bool NoConfirmation = (WinConfiguration->DDTransferConfirmation == asOff);
|
|
|
+ TAutoFlag Flag(FDownloadingFromClipboard);
|
|
|
ClipboardDownload(ExtractFilePath(FileName), NoConfirmation, true);
|
|
|
}
|
|
|
}
|