The wallet password prompt takes the keyboard only after its 300 ms fade-in, so an early key goes into the field behind it #1134

Open
opened 2026-11-13 15:16:59 +00:00 by jarolrod · 1 comment
jarolrod commented 2026-11-13 15:16:59 +00:00 (Migrated from github.com)

The wallet password prompt does not take the keyboard while it fades in. For about 0.3 s after the click that raises it, what is typed or pasted goes to the field that had the caret, in clear text, and the password is then reported as incorrect. On Send that field can be the amount.

To reproduce, with an encrypted wallet whose passphrase starts with a digit, here 5:

  1. On Send, enter an address and type the amount 1, leaving the caret in the amount field.
  2. Click Review Transaction and start typing the passphrase at once.

The amount reads 15. The prompt holds the rest of the passphrase and answers "The wallet password you entered was incorrect." After the passphrase is typed again in full, Review shows 15.00000000 BTC. Nothing was sent.

Field with the caret Early input Result
Send amount 1 one digit 15, 2 of 2 (0.5 became 0.59, 3 of 3)
Send Note to self the passphrase, typed from the click on its first 2 to 4 characters are added to the note, 14 of 14
Send Note to self a paste the whole clipboard text is in the note; the prompt stays empty, with no error; 28 of 28 up to 273.5 ms
Custom fee rate 2 one digit 25, 26 of 26 up to 275 ms; Review shows 25 sat/vB; one payment sent paid 3,525 sat against 282
Sign message, the message the first characters added to the message; the retry signs the altered message
Any of these input after the fade-in goes into the prompt

Review shows the changed amount, note and fee rate before anything is sent. If it is sent, the note is saved as the payee address's label, which the wallet file does not encrypt and the app's pages cannot edit (#638).

The prompt is a modal popup without focus: true. It has a 300 ms enter transition:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/components/WalletPassphrasePopup.qml (L42-L57)

and gives its field the focus only in onOpened, which Qt emits when the transition has finished:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/components/WalletPassphrasePopup.qml (L89-L92)

On Sign message the prompt's field had the focus 285 to 334 ms after the click in 26 of 30 polls, on a loaded machine. The app's AlertPopup sets focus: true and had the focus at the first sample, 12 of 12. With a mouse this is macOS only, by Qt's source: there a Qt Quick button does not take the focus when clicked, so the caret stays in the field. Linux and Windows were not run. Bitcoin-Qt's prompt, by its source, is a modal dialog that takes the keyboard when shown.

Seven other dialogs have no focus: true and never take the keyboard. In Open payment request the text box has no caret and typing goes to the Send form behind it.

#1052 at e89a2bcd4624 and #1060 at 733018ca9eab rebuild the prompt on a dialog base with focus: true, by their diffs. Keys would no longer reach the page, but early characters would be dropped and the first attempt would still fail.

Reproduced on qt6 at 2bd5a61e8304 and eed1f426fcb6, macOS arm64 / Qt 6.9.0, isolated regtest. The Send cases are offscreen only; Sign message also in a native window. Limits:

  • No physical key, Cmd+V or pointer click was used in the app. The click was the button's own click, sent through the test bridge. Each early key was a key event sent to the item the window reported as its focus item, and the paste was that item's paste function.
  • That a real click leaves the caret in the field, and that a real key then reaches it, rest on Qt's source and on a small Qt 6.9.0 program with a real click and keys sent to the window: 9 of 9 early keys went behind the popup.
  • It needs input within about 0.3 s of the click, while the prompt is still nearly transparent. I do not know whether that happens at an ordinary pace.
The wallet password prompt does not take the keyboard while it fades in. For about 0.3 s after the click that raises it, what is typed or pasted goes to the field that had the caret, in clear text, and the password is then reported as incorrect. On **Send** that field can be the amount. To reproduce, with an encrypted wallet whose passphrase starts with a digit, here 5: 1. On **Send**, enter an address and type the amount `1`, leaving the caret in the amount field. 2. Click **Review Transaction** and start typing the passphrase at once. The amount reads 15. The prompt holds the rest of the passphrase and answers "The wallet password you entered was incorrect." After the passphrase is typed again in full, Review shows 15.00000000 BTC. Nothing was sent. | Field with the caret | Early input | Result | |---|---|---| | Send amount `1` | one digit | 15, 2 of 2 (`0.5` became 0.59, 3 of 3) | | Send **Note to self** | the passphrase, typed from the click on | its first 2 to 4 characters are added to the note, 14 of 14 | | Send **Note to self** | a paste | the whole clipboard text is in the note; the prompt stays empty, with no error; 28 of 28 up to 273.5 ms | | Custom fee rate `2` | one digit | 25, 26 of 26 up to 275 ms; Review shows 25 sat/vB; one payment sent paid 3,525 sat against 282 | | Sign message, the message | the first characters | added to the message; the retry signs the altered message | | Any of these | input after the fade-in | goes into the prompt | Review shows the changed amount, note and fee rate before anything is sent. If it is sent, the note is saved as the payee address's label, which the wallet file does not encrypt and the app's pages cannot edit (#638). The prompt is a modal popup without `focus: true`. It has a 300 ms enter transition: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/components/WalletPassphrasePopup.qml#L42-L57 and gives its field the focus only in `onOpened`, which Qt emits when the transition has finished: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/components/WalletPassphrasePopup.qml#L89-L92 On Sign message the prompt's field had the focus 285 to 334 ms after the click in 26 of 30 polls, on a loaded machine. The app's `AlertPopup` sets `focus: true` and had the focus at the first sample, 12 of 12. With a mouse this is macOS only, by Qt's source: there a Qt Quick button does not take the focus when clicked, so the caret stays in the field. Linux and Windows were not run. Bitcoin-Qt's prompt, by its source, is a modal dialog that takes the keyboard when shown. Seven other dialogs have no `focus: true` and never take the keyboard. In **Open payment request** the text box has no caret and typing goes to the Send form behind it. #1052 at `e89a2bcd4624` and #1060 at `733018ca9eab` rebuild the prompt on a dialog base with `focus: true`, by their diffs. Keys would no longer reach the page, but early characters would be dropped and the first attempt would still fail. Reproduced on `qt6` at `2bd5a61e8304` and `eed1f426fcb6`, macOS arm64 / Qt 6.9.0, isolated regtest. The Send cases are offscreen only; Sign message also in a native window. Limits: - No physical key, Cmd+V or pointer click was used in the app. The click was the button's own click, sent through the test bridge. Each early key was a key event sent to the item the window reported as its focus item, and the paste was that item's paste function. - That a real click leaves the caret in the field, and that a real key then reaches it, rest on Qt's source and on a small Qt 6.9.0 program with a real click and keys sent to the window: 9 of 9 early keys went behind the popup. - It needs input within about 0.3 s of the click, while the prompt is still nearly transparent. I do not know whether that happens at an ordinary pace.
jarolrod commented 2026-11-14 12:30:08 +00:00 (Migrated from github.com)

#1052 fixed most of this. On qt6 at efc4a2c754eb no early key or paste reached the field behind the prompt in any run: the Send amount stayed 1, and the note and the message to sign were unchanged.

Two smaller things remain. Where an early key goes now depends on how the prompt was last closed:

Prompt opened Focus during the fade-in Early key
First time in the session the prompt's content, not its field dropped; the first attempt is "incorrect", 6 of 6
After a successful unlock the password field goes into the prompt; the first attempt succeeds, 6 of 6
After a click on Cancel the Cancel button, until about 320 ms letters dropped, first attempt "incorrect"; an early Space presses Cancel and closes the prompt, 7 of 7

The field gets the keyboard only when the fade has finished:

github.com/bitcoin-core/gui-qml@efc4a2c754/qml/controls/DialogPopup.qml (L192-L213)

Giving the field focus as the prompt opens, as it already has after a successful unlock, would cover both. The seven other dialogs mentioned above now all take the keyboard; Open payment request has the caret.

Reproduced offscreen on efc4a2c754eb, macOS arm64 / Qt 6.9.0, isolated regtest. Early keys were key events sent through the test bridge to the window's focus item; no physical key was pressed. The custom fee-rate row was not re-run.

#1052 fixed most of this. On `qt6` at `efc4a2c754eb` no early key or paste reached the field behind the prompt in any run: the Send amount stayed 1, and the note and the message to sign were unchanged. Two smaller things remain. Where an early key goes now depends on how the prompt was last closed: | Prompt opened | Focus during the fade-in | Early key | |---|---|---| | First time in the session | the prompt's content, not its field | dropped; the first attempt is "incorrect", 6 of 6 | | After a successful unlock | the password field | goes into the prompt; the first attempt succeeds, 6 of 6 | | After a click on **Cancel** | the **Cancel** button, until about 320 ms | letters dropped, first attempt "incorrect"; an early Space presses **Cancel** and closes the prompt, 7 of 7 | The field gets the keyboard only when the fade has finished: https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/controls/DialogPopup.qml#L192-L213 Giving the field focus as the prompt opens, as it already has after a successful unlock, would cover both. The seven other dialogs mentioned above now all take the keyboard; **Open payment request** has the caret. Reproduced offscreen on `efc4a2c754eb`, macOS arm64 / Qt 6.9.0, isolated regtest. Early keys were key events sent through the test bridge to the window's focus item; no physical key was pressed. The custom fee-rate row was not re-run.
Sign in to join this conversation.
No description provided.