Skip to content
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

Merged
4 commits merged into from Mar 10, 2022
Merged

Fix showing a dialog multiple times #12625

4 commits merged into from Mar 10, 2022

Conversation

zadjii-msft
Copy link
Member

After the dialog is displayed, always clear it out. If we don't, we won't be able to display another!

After the dialog is displayed, always clear it out. If we don't, we won't be able to display another!

* regressed in #12517.
* [x] Fixes #12622.
@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Mar 4, 2022
@zadjii-msft zadjii-msft added this to Todo in Win11 Style Backport Tracker via automation Mar 4, 2022
@zadjii-msft zadjii-msft added the zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. label Mar 4, 2022
Comment on lines 384 to 386
// 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;
Copy link
Member

@lhecker lhecker Mar 4, 2022

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.

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Mar 9, 2022
@ghost
Copy link

ghost commented Mar 9, 2022

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 2e78ebf into main Mar 10, 2022
@ghost ghost deleted the dev/migrie/b/12622-paste-paste branch March 10, 2022 14:16
@DHowett DHowett added this to To Cherry Pick in 1.13 Servicing Pipeline Mar 10, 2022
@zadjii-msft zadjii-msft moved this from Todo to In Progress in Win11 Style Backport Tracker Mar 10, 2022
@zadjii-msft zadjii-msft moved this from In Progress to Verified in Win11 Style Backport Tracker Mar 10, 2022
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.13 Servicing Pipeline Mar 10, 2022
DHowett pushed a commit that referenced this pull request Mar 10, 2022
After the dialog is displayed, always clear it out. If we don't, we won't be able to display another!

* regressed in #12517.
* [x] Fixes #12622.

(cherry picked from commit 2e78ebf)
zadjii-msft added a commit that referenced this pull request Mar 10, 2022
After the dialog is displayed, always clear it out. If we don't, we won't be able to display another!

* regressed in #12517.
* [x] Fixes #12622.
@ghost
Copy link

ghost commented Mar 25, 2022

🎉Windows Terminal Preview v1.13.1073 has been released which incorporates this pull request.:tada:

Handy links:

zadjii-msft added a commit that referenced this pull request Apr 6, 2022
ghost pushed a commit that referenced this pull request Apr 6, 2022
…#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
DHowett pushed a commit that referenced this pull request Apr 6, 2022
…#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
DHowett pushed a commit that referenced this pull request Apr 6, 2022
…#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
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.13 Servicing Pipeline May 10, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Pasting multiple lines, multiple times is broken in main
3 participants