-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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 exit
ing a zoomed pane
#7973
Conversation
…xit-zoomed-pane # Conflicts: # src/cascadia/TerminalApp/Pane.cpp # src/cascadia/TerminalApp/Tab.idl
…ses, but it doesn't play nicely with the animation. Also, there's a bit on L714 in Pane.cpp from the previous commit that should be a part of this commit, not the merge -___-
Closing a pane that's zoomed doesn't work, so I thought it might be fun to add a unit test. This is a test of _creating_ a zoomed pane, not closing the zoomed one, but we'll get there.
@@ -88,6 +87,8 @@ namespace winrt::TerminalApp::implementation | |||
// The TabViewNumTabs is the number of Tab objects in TerminalPage's _tabs vector. | |||
OBSERVABLE_GETSET_PROPERTY(uint32_t, TabViewNumTabs, _PropertyChangedHandlers, 0); | |||
|
|||
OBSERVABLE_GETSET_PROPERTY(winrt::Windows::UI::Xaml::UIElement, Content, _PropertyChangedHandlers, 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.
/cc @leonMSFT this will conflict with you i bet
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.
it probably will, but at least I named the variable Content
as well 😄, i think the merge conflict won't be too bad for this property, it'll probably be bad in terms of me literally deleting Tab.cpp
and replacing it with TerminalTab.cpp
. though if you merge this PR first I'd be willing to resolve those conflicts 👍
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.
Love it!
Hello @zadjii-msft! 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 (
|
@leonMSFT I might have a conflict resolution prepared for this, as I wanted to produce a selfhost build. If you look over this and deem it correct, I can push it into f/sui. There's no way to get github to show the recorded resolution for merge conflicts, so I had to paste in a resolution patch. It shows two columns of
|
@DHowett looks good to me! 👍 |
Done! |
Fixes the bug where `exit`ing inside a closed pane would leave the Terminal blank. Additionally, removes `Tab::GetRootElement` and replaces it with the _observable_ `Tab::Content`. This should be more resilient in the future. Also adds some tests, though admittedly not for this exact scenario. This scenario requires a cooperating TerminalConnection that I can drive for the sake of testing, and _ain't nobody got time for that_. * Introduced in #6989 * [x] Closes #7252 * [x] I work here * [x] Tests added/passed 🎉 * [n/a] Requires documentation to be updated From notes I had left in `Tab.cpp` while I was working on this: ``` OKAY I see what's happening here the ActivePaneChanged Handler in TerminalPage doesn't re-attach the tab content to the tree, it just updates the title of the window. So when the pane is `exit`ed, the pane's control is removed and re-attached to the parent grid, which _isn't in the XAML tree_. And no one can go tell the TerminalPage that it needs to re set up the tab content again. The Page _manually_ does this in a few places, when various pane actions are about to take place, it'll unzoom. It would be way easier if the Tab could just manage the content of the page. Or if the Tab just had a Content that was observable, that when that changed, the page would auto readjust. That does sound like a LOT of work though. ``` Opened panes, closed panes, exited panes, zoomed panes, moved focus between panes, panes, panes, panes (cherry picked from commit ccf9f03)
🎉 Handy links: |
🎉 Handy links: |
Summary of the Pull Request
Fixes the bug where
exit
ing inside a closed pane would leave the Terminal blank.Additionally, removes
Tab::GetRootElement
and replaces it with the observableTab::Content
. This should be more resilient in the future.Also adds some tests, though admittedly not for this exact scenario. This scenario requires a cooperating TerminalConnection that I can drive for the sake of testing, and ain't nobody got time for that.
References
togglePaneZoom
action for zooming a pane #6989PR Checklist
Detailed Description of the Pull Request / Additional comments
From notes I had left in
Tab.cpp
while I was working on this:Validation Steps Performed
Opened panes, closed panes, exited panes, zoomed panes, moved focus between panes, panes, panes, panes