-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix showing a dialog multiple times #12625
Conversation
// GH#12622: After the dialog is displayed, always clear it out. If we | ||
// don't, we won't be able to display another! | ||
_dialog = nullptr; |
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.
Above it says
_dialog = dialog;
To make this code robust against exceptions and future early returns I'd suggest changing it to:
_dialog = dialog;
const auto cleanup = wil::scope_exit([this]() {
_dialog = nullptr;
});
...and revert this new code.
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
This reverts commit 2e78ebf.
…#12840) After switching to ControlsV2, it seems that delay-loading a dialog causes the ContentDialog to be assigned a Height equal to it's content size. If we DON'T assign the ContentDialog a Row, I believe it's assigned Row 0 by default. So, when the dialog gets opened, the dialog seemingly causes a giant hole to appear in the body of the app. Assigning all the dialogs to Row 2 (where the rest of the content is) makes the "hole" appear in the same space as the rest of the TabContent, fixing the issue. Note that the actual content in a content dialog gets parented to the PopupRoot, so it actually always appeared in the correct place, it's just this weird hole that appeared in Row 0. * [x] Closes #12775 * See also: * #12202 was fixed by #12208 * #12447 was fixed by #12517 * [x] Tested manually * [x] Reverts #12625 * [x] Reverts #12517
…#12840) After switching to ControlsV2, it seems that delay-loading a dialog causes the ContentDialog to be assigned a Height equal to it's content size. If we DON'T assign the ContentDialog a Row, I believe it's assigned Row 0 by default. So, when the dialog gets opened, the dialog seemingly causes a giant hole to appear in the body of the app. Assigning all the dialogs to Row 2 (where the rest of the content is) makes the "hole" appear in the same space as the rest of the TabContent, fixing the issue. Note that the actual content in a content dialog gets parented to the PopupRoot, so it actually always appeared in the correct place, it's just this weird hole that appeared in Row 0. * [x] Closes #12775 * See also: * #12202 was fixed by #12208 * #12447 was fixed by #12517 * [x] Tested manually * [x] Reverts #12625 * [x] Reverts #12517 (cherry picked from commit c4e5ebf) Service-Card-Id: 80266902 Service-Version: 1.12
…#12840) After switching to ControlsV2, it seems that delay-loading a dialog causes the ContentDialog to be assigned a Height equal to it's content size. If we DON'T assign the ContentDialog a Row, I believe it's assigned Row 0 by default. So, when the dialog gets opened, the dialog seemingly causes a giant hole to appear in the body of the app. Assigning all the dialogs to Row 2 (where the rest of the content is) makes the "hole" appear in the same space as the rest of the TabContent, fixing the issue. Note that the actual content in a content dialog gets parented to the PopupRoot, so it actually always appeared in the correct place, it's just this weird hole that appeared in Row 0. * [x] Closes #12775 * See also: * #12202 was fixed by #12208 * #12447 was fixed by #12517 * [x] Tested manually * [x] Reverts #12625 * [x] Reverts #12517 (cherry picked from commit c4e5ebf) Service-Card-Id: 80266903 Service-Version: 1.13
After the dialog is displayed, always clear it out. If we don't, we won't be able to display another!