Decouple "Active Terminal" and "Focused Control"#3540
Merged
zadjii-msft merged 15 commits intomasterfrom Nov 18, 2019
Merged
Conversation
If I want to double up and also fix #522 (which I do), then I need to also * when a tab GetsFocus, send the focus instead to the Pane * When the border is clicked on, focus that pane's control And like a lot of cleanup, because this is horrifying
If the border is `Transparent`, then it can't hittest for Tapped events, and it'll fall through (to someone) THis at least works, but looks garish
carlos-zamora
approved these changes
Nov 12, 2019
This was referenced Nov 14, 2019
Contributor
DHowett-MSFT
left a comment
There was a problem hiding this comment.
I’d like to understand a couple things:
- Should the event in Tab also be an event?
- why is the event lambda in
Tab::SplitPanedifferent from the one inAttachPaneEventHandlers(sic)? Why is one attached in Split and the other attached in a helper?
Member
Author
|
DHowett-MSFT
approved these changes
Nov 18, 2019
3 tasks
|
🎉 Handy links: |
This was referenced Nov 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Unties the concept of "focused control" from "active control".
Previously, we were exclusively using the "Focused" state of
TermControls to determine which one was active. This was fraught with gotchas - if anything else became focused, then suddenly there was no pane focused in the Tab. This happened especially frequently if the user clicked on a tab to focus the window. Furthermore, in experimental branches with more UI added to the Terminal (such as dev/migrie/f/2046-command-palette), when these UIs were added to the Terminal, they'd take focus, which again meant that there was no focused pane.This fixes these issue by having each Tab manually track which Pane is active in that tab. The Tab is now the arbiter of who in the tree is "active". Panes still track this state, for them to be able to MoveFocus appropriately.
It also contains a related fix to prevent the tab separator from stealing focus from the TermControl. This required us to set the color of the un-focused Pane border to some color other that Transparent, so I went with the TabViewBackground. Panes now look like the following:
References
See also: #2046
PR Checklist
Validation Steps Performed
Tested manually opening panes, closing panes, clicking around panes, the whole dance.