-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect dialog modality and fix a regression in wallet unlock #509
Conversation
I was unable to reproduce the issue mentioned in bitcoin/bitcoin#23790 using PR branch, so issue might be fixed. There was a password prompt each time I tried to send bitcoin from an encrypted wallet. Would like to test few more things and go through each commit since there are 11 commits in this PR before ACK |
testedACK for the issue mentioned in bitcoin/bitcoin#23790 |
702a243
to
80e7e30
Compare
Updated 702a243 -> 80e7e30 (pr509.01 -> pr509.02, diff). Dropped
|
I get this when I try to load a PSBT for signing. This does not happen in v22.0 PSBT:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 80e7e30
This PR fixes the bug reported in bitcoin/bitcoin#23790 and I did not find any issues with the code or testing other things.
There is some error in CI though which I missed earlier: https://github.com/bitcoin-core/gui/pull/509/checks?check_run_id=4570631121 |
80e7e30
to
356e21f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reACK 356e21f
@hebasto have you tried to fix the regression without reverting the other change? |
@hebasto I can see why, there are multiple cases. Not sure how I didn't catch I think the best course of action is to revert and follow up with necessary refactors. Concept ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 356e21f
Verified that the error mentioned in bitcoin/bitcoin#23790 happens in master branch and this PR fixes it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a632303 indeed fixes the no lock after send regression for me. But it introduces some (much less problematic) regressions, at least on macOS.
sign_action->setEnabled(signMessageAction->isEnabled()); | ||
verify_action->setEnabled(verifyMessageAction->isEnabled()); | ||
if (QApplication::activeModalWidget()) { | ||
for (QAction* a : trayIconMenu.get()->actions()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
97692af: I don't see any difference in behavior on macOS; before and after this commit, if I open coin selection, it disables everything except the macOS standard items (Options, Show all windows, Hide, Stop)
@@ -265,7 +265,11 @@ void BitcoinApplication::createWindow(const NetworkStyle *networkStyle) | |||
connect(window, &BitcoinGUI::quitRequested, this, &BitcoinApplication::requestShutdown); | |||
|
|||
pollShutdownTimer = new QTimer(window); | |||
connect(pollShutdownTimer, &QTimer::timeout, window, &BitcoinGUI::detectShutdown); | |||
connect(pollShutdownTimer, &QTimer::timeout, [this]{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cda881a : on macOS when I'm in coin control, before and after this commit, Command + Q is ignored (not delayed). Same with Stop from the tray menu. (that's fine by the way, a delayed shutdown seems confusing)
But when I hit ctrl + c in the terminal, before this commit it would shut QT down, with this commit it indeed delays the shutdown until the dialog is closed. (that's also fine, because this method of shutdown is probably only used by developers)
356e21f
to
3daaa4c
Compare
This change is required for the following commits.
Also dropped useless tooltip.
3daaa4c
to
74e638a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 74e638a
if (show_hide_action) show_hide_action->setText( | ||
(!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ? | ||
tr("&Hide") : | ||
tr("S&how")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fd667e7: you may want to delay this keyboard shortcut, because we're past the translation cut-off?
On macOS another behavior change noticed. On master, due to Line 316 in b7942c9
optionsAction has forcibly been hidden in the Dock menu (according to design guide, it is moved into application menu):
With this PR @Sjors What do think about this behavior change? |
It seems confusing to have "Options..." and "Options ->" in a single dropdown. I don't care deeply, but maybe just keep the original behavior? |
I don't care about UI issues with Mac but this pull request addresses an issue which affects security on every platform, works as expected so I have no issues with it. Would have been better if reverting changes were simple and less line of code in this PR. Hopefully we don't ship v23.0 with a known issue that affects security. ACK 74e638a |
This change is required for the following commit.
The AskPassphraseDialog modal dialog must be synchronous here as expected in the WalletModel::requestUnlock() function. Fixed an introduced regression.
-BEGIN VERIFY SCRIPT- sed -i 's/ShowModalDialogAndDeleteOnClose/ShowModalDialogAsynchronously/' -- $(git grep -l -e "ShowModalDialogAndDeleteOnClose") -END VERIFY SCRIPT- It is important to highlight that a modal dialog is showed asynchronously as there are cases when the synchronous QDialog::exec() is required.
74e638a
to
f730bd7
Compare
@prayank23 @Sjors Would you mind re-acking? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post merge tACK, only difference is the |
Post merge tACK, I was able to reproduce the original issue and I've done testing to ensure that this PR fixes this. |
c515829 qt: Update translation source file (Hennadii Stepanov) Pull request description: As the part of the v23.0 [release process](bitcoin/bitcoin#22969) this PR updates translation source file, `src/qt/locale/bitcoin_en.xlf`. The following changes are reflected in this PR: - small string changes from #509 - internal technical details from bitcoin/bitcoin#22151 ACKs for top commit: laanwj: ACK c515829 Tree-SHA512: 2cf08f5b356dca25f99b0342645db5253eab0854796cf44fa52f8a6cf28f6d3f973e21589e0f9d3fef40a1b21b3f0aee00c9ca0897109a1967f9ef3320dd508f
I wonder if this was also a problem when creating a wallet, see #571. |
As pointed in bitcoin/bitcoin#23790 a regression in wallet unlock was introduced in #336 when a synchronous
AskPassphraseDialog
has been replaced with an asynchronous one.This PR reverts a call back to a synchronous mode.
To make synchronous dialogs behave nice during shutdown some additional changes were made.
Please note that disabling the tray icon menu when a modal dialog is active is useful itself as on master (4ad5904) it is possible to switch to the "Receive" tab while the GUI is waiting for a password for the "Send" tab:
This is confusing and must be avoided.
Fixes bitcoin/bitcoin#23790.