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 single-tab window tear-off crash #17251

Merged
merged 3 commits into from
May 13, 2024

Conversation

tusharsnx
Copy link
Contributor

@tusharsnx tusharsnx commented May 12, 2024

Validation Steps Performed

  • Opened multi-tab terminal window with Narrator. Narrator can read characters from the tabs.
  • Started a drag and drop (tear-off) of a tab, and it didn't crash. This was repeated multiple times.

@@ -1051,7 +1051,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// MSFT 33353327: We're purposefully not using _initializedTerminal to ensure we're fully initialized.
// Doing so makes us return nullptr when XAML requests an automation peer.
// Instead, we need to give XAML an automation peer, then fix it later.
if (!_IsClosing())
if (!_IsClosing() && !_detached)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to instead check for !_interactivity since it's used below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When termcontrol isn't detached or closing we expect _interactivity to be non-null, no?

Given #10971 has happened in the past, I think THROW_HR_IF_NULL(E_UNEXPECTED, _interactivity) is better suited.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this for now

@tusharsnx
Copy link
Contributor Author

Unlinked #17246 because this doesn't fix all the issues mentioned in that thread.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@DHowett DHowett added this pull request to the merge queue May 13, 2024
Merged via the queue into microsoft:main with commit 30ef1f4 May 13, 2024
15 checks passed
DHowett pushed a commit that referenced this pull request May 13, 2024
## Validation Steps Performed
- Opened multi-tab terminal window with Narrator. Narrator can read
characters from the tabs.
- Started a drag and drop (tear-off) of a tab, and it didn't crash. This
was repeated multiple times.

(cherry picked from commit 30ef1f4)
Service-Card-Id: 92546868
Service-Version: 1.20
DHowett pushed a commit that referenced this pull request May 13, 2024
## Validation Steps Performed
- Opened multi-tab terminal window with Narrator. Narrator can read
characters from the tabs.
- Started a drag and drop (tear-off) of a tab, and it didn't crash. This
was repeated multiple times.

(cherry picked from commit 30ef1f4)
Service-Card-Id: 92546869
Service-Version: 1.21
@tusharsnx tusharsnx deleted the fix-single-tab-window-tear-off branch May 20, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants