-
Notifications
You must be signed in to change notification settings - Fork 262
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
Bugfix - don't allow multiple dialogs for same tx in TransactionView #817
base: master
Are you sure you want to change the base?
Bugfix - don't allow multiple dialogs for same tx in TransactionView #817
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
would be nice if a click on a row where the dialog is already open would bring that dialog to the foreground |
Great suggestion! I'll try that since I have to fix a lint. Thanks! |
dbbec32
to
b26d2e8
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.
Tested ACK b26d2e8. Only one dialog is opened for a single tx.
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.
Tested ACK b26d2e8
Tested successfully on Ubuntu 22.04.4 LTS. Only one dialogue is created per transaction and the clicked transaction is brought to the foreground
Screencast.from.24-04-2024.03.35.10.ALASIRI.webm
Why? |
b26d2e8
to
ba13f10
Compare
Discussed a bit offline... Please feel free to add more context here and any concerns you have. |
Updates:
|
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.
Re ACK ba13f10. I tested in Mac and now the dialog is brought to the foreground
pr.mov
Concept ACK. Such a behavior can confuse the user. |
Tested on Ubuntu 24.04. It works with |
I'll take a look, thanks! |
@hebasto it seems there are some issues with Wayland on how these actions are being handled (this one specific to KDE but found some old ones in gnome). As a workaround (tried other things as well), might be not elegant, but this works fine on both X11/Xorg and Wayland: --- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -671,8 +671,11 @@ bool TransactionView::detailsAlreadyShown(const QModelIndex &idx)
{
for (TransactionDescDialog* dlg : m_opened_dialogs) {
if (dlg->getTransactionId() == idx.data(TransactionTableModel::TxHashRole).toString()) {
- dlg->activateWindow();
- dlg->raise();
+ auto eFlags = dlg->windowFlags();
+ dlg->setWindowFlags(eFlags|Qt::WindowStaysOnTopHint);
+ dlg->show();
+ dlg->setWindowFlags(eFlags);
+ dlg->show();
return true;
}
} I can update the code with that snippet above or we can do it on a follow-up. |
The approach you suggested works for me. Here are other references to this workaround:
I think we should first fix our Then we can apply the fixed |
Ok, I'll open a new PR for |
ba13f10
to
5aec5d2
Compare
15aa7d0 gui, qt: brintToFront workaround for Wayland (pablomartin4btc) Pull request description: There are known issues around handling windows focus in `Wayland` ([this one specific](https://bugs.kde.org/show_bug.cgi?id=462574) in KDE but also in [gnome](https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/730)). The idea is that the workaround will be executed if `bitcoin-qt` is running using `Wayland` platform (e.g.: `QT_QPA_PLATFORM=wayland ./src/qt/bitcoin-qt -regtest`), since the workaround behaviour looks like re-opening the window again (which I tried to fix by moving the window to the original position and/ or re-setting the original geometry without success) while in `X11` (not sure in Mac) the current `GUIUtil::brintToFront` actually sets the focus to the desired window, keeping its original position as expected, and I didn't want to change that (`X11` behaviour). The solution was [initially discussed](bitcoin-core/gui#817 (comment)) with hebasto in #817. ACKs for top commit: hebasto: ACK 15aa7d0. Tree-SHA512: 141d6cc4a618026e551627b9f4cc284285980db02a54a7b19c7de91e8c5adccf0c1d67380625146b5413e58c59f39c9e944ed5ba68cb8644f67647518918b6f7
Only one tx details dialog that a user can open per tx id is enough.
5aec5d2
to
0f77a6e
Compare
Updates:
|
Limit to one the transaction details dialogs that a user can open.
Currently a user can open unlimited tx details dialogs for the same tx id.
This PR fixes the issue.