Browse Source

Issue 2320 – Shift+Ctrl+P keyboard shortcut on Login dialog to open site in PuTTY without closing the dialog does not work

https://winscp.net/tracker/2320
(cherry picked from commit 48414234901222fee0bce67ca26d8d84e6f33f17)

Source commit: 9143eab3d47eb23df060710ae4533aa8f39f86f1
Martin Prikryl 1 year ago
parent
commit
05838dc968
1 changed files with 12 additions and 0 deletions
  1. 12 0
      source/forms/Login.cpp

+ 12 - 0
source/forms/Login.cpp

@@ -3166,6 +3166,18 @@ void __fastcall TLoginDialog::LoginActionExecute(TObject * /*Sender*/)
 //---------------------------------------------------------------------------
 void __fastcall TLoginDialog::PuttyActionExecute(TObject * /*Sender*/)
 {
+  std::unique_ptr<TAutoFlag> AutoFlag;
+  if (PuttyAction->ActionComponent == NULL)
+  {
+    // Resolving conflict between copying command to clipboard on Ctrl+Shift and Ctrl+Shift+P keyboard shortcut.
+    // Ctrl+Shift to copy to clipboard now works with menu invocations only.
+    AutoFlag.reset(new TAutoFlag(DontCopyCommandToClipboard));
+  }
+  else
+  {
+    // does not clear on its own
+    PuttyAction->ActionComponent = NULL;
+  }
   // following may take some time, so cache the shift key state,
   // in case user manages to release it before following finishes
   bool Close = !OpenInNewWindow();