From 16a59b5972f6bc108876162ce389668d66a0166a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 22 Apr 2021 19:47:13 +0100 Subject: [PATCH] winpgnt: say 'click to focus' in async passphrase prompt. I continue to believe that there's nothing I can (or should) do about the fact that on Windows, Pageant's async passphrase prompt dialog box doesn't automatically get the input focus when it pops up in response to a request received via invisible IPC. However, one thing I can do is add some text to the box that _warns_ people about it, so that at least there's some kind of suggestion that you should get into the habit of clicking on the passphrase prompt before typing your passphrase into it. (I would be less concerned about all of this if it weren't for the fact that focus is surprisingly non-obvious on Windows 10, at least on the machine I have here. When the window doesn't have focus, the title bar has the same background colour, and only the text is fainter. And perhaps more confusingly, the cursor in the edit box still flashes! That fooled _me_ a few times to begin with.) --- windows/pageant-rc.h | 3 ++- windows/pageant.rc | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/windows/pageant-rc.h b/windows/pageant-rc.h index abe92dc4..3133a9ca 100755 --- a/windows/pageant-rc.h +++ b/windows/pageant-rc.h @@ -14,7 +14,8 @@ #define IDC_PASSPHRASE_STATIC1 100 #define IDC_PASSPHRASE_FINGERPRINT 101 #define IDC_PASSPHRASE_STATIC2 102 -#define IDC_PASSPHRASE_EDITBOX 103 +#define IDC_PASSPHRASE_STATIC3 103 +#define IDC_PASSPHRASE_EDITBOX 104 #define IDC_KEYLIST_LISTBOX 100 #define IDC_KEYLIST_ADDKEY 101 diff --git a/windows/pageant.rc b/windows/pageant.rc index 12fd7828..88010e3a 100644 --- a/windows/pageant.rc +++ b/windows/pageant.rc @@ -27,7 +27,7 @@ BEGIN PUSHBUTTON "&Cancel", IDCANCEL, 80, 42, 40, 14 END -IDD_ONDEMAND_PASSPHRASE DIALOG DISCARDABLE 0, 0, 250, 70 +IDD_ONDEMAND_PASSPHRASE DIALOG DISCARDABLE 0, 0, 250, 78 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Pageant: Decrypting Stored Key" FONT 8, "MS Shell Dlg" @@ -35,12 +35,14 @@ BEGIN CTEXT "A client of Pageant wants to use the following encrypted key:", IDC_PASSPHRASE_STATIC1, 10, 6, 230, 8 CTEXT "", IDC_PASSPHRASE_FINGERPRINT, 10, 16, 230, 8 - CTEXT "If you intended this, enter the passphrase to decrypt the key.", + CTEXT "If you intended this, click in this box to make sure it has", IDC_PASSPHRASE_STATIC2, 10, 26, 230, 8 - EDITTEXT IDC_PASSPHRASE_EDITBOX, 10, 36, 230, 12, + CTEXT "input focus, then enter the passphrase to decrypt the key.", + IDC_PASSPHRASE_STATIC3, 10, 34, 230, 8 + EDITTEXT IDC_PASSPHRASE_EDITBOX, 10, 44, 230, 12, ES_PASSWORD | ES_AUTOHSCROLL - DEFPUSHBUTTON "O&K", IDOK, 75, 52, 40, 14 - PUSHBUTTON "&Cancel", IDCANCEL, 135, 52, 40, 14 + DEFPUSHBUTTON "O&K", IDOK, 75, 60, 40, 14 + PUSHBUTTON "&Cancel", IDCANCEL, 135, 60, 40, 14 END IDD_KEYLIST DIALOG DISCARDABLE 0, 0, 450, 236