-
Notifications
You must be signed in to change notification settings - Fork 9k
Split TermControl into a Core, Interactivity, and Control layer
#9820
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
Merged
Merged
Changes from all commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
0bd30c2
Move everything to a fresh branch
zadjii-msft b0f1fa4
fix some build breaks, because I was only playing in TerminalControl
zadjii-msft 243867a
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-tear-a…
zadjii-msft acf84f1
hey look it launches. But there's definitely a good amount of broken …
zadjii-msft 5e655ef
I wasn't the murderer after all
zadjii-msft 2402c59
Hokay, so that gets the control as a lib/dll split
zadjii-msft 24765d7
its-all-coming-together.gif
zadjii-msft 54f443b
can I get a big woop woop from all my homies
zadjii-msft 322d511
Fix the tests
zadjii-msft 8f8cf59
Rename Microsoft.Terminal.TerminalControl to just Microsoft.Terminal.…
zadjii-msft eee5bee
some dead code
zadjii-msft 04d403c
Change the GUID, project name
zadjii-msft e8d06d7
Merge remote-tracking branch 'origin/main' into dev/migrie/r/split-te…
zadjii-msft f8e969e
oh! IT CAUGHT AN ISSUE! YAY!
zadjii-msft 8c6c7ec
Bite-sized refactor: Move all the args in TermControl to their own fi…
zadjii-msft 2f532bd
Hey, lets clean this up while we're at it
zadjii-msft 093e8ac
Merge remote-tracking branch 'origin/dev/migrie/oop-tear-apart-contro…
zadjii-msft c035e69
Reorganize these files to be a little less painful to read
zadjii-msft 801b296
Move isReadOnly to the core as well, through that really belongs in i…
zadjii-msft 6ab8339
Ooh, do the font size event too
zadjii-msft df5f973
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-termin…
zadjii-msft c29ffba
Start moving things to a shared middle bit too
zadjii-msft 72c35a8
Move _UpdateSystemParameterSettings, 30 errors remain
zadjii-msft 541d151
I suppose this should have been in the parent commit
zadjii-msft 2035fcd
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft bbf605b
I think this needs to go in main
zadjii-msft ad88c6a
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft ed79dab
Move PointerPressed to ControlInteractivity
zadjii-msft 618b207
Move more mouse methods
zadjii-msft e85bdff
Move around the clipboard handling methods
zadjii-msft 60b939e
An easy fix for 4 total errors
zadjii-msft db1c36c
Try to move most of the mouse wheel handlers
zadjii-msft 4d8c85b
Stashing this, down to 4 errors? But I don't think this is hooked up …
zadjii-msft 7510176
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 7b02393
HAHAHAHA IT builds again, 0 ERRORS REMAIN
zadjii-msft 7a0dc43
its full of bugs
zadjii-msft 68f3753
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 2ac8318
dead code cleanup crew
zadjii-msft 1b3dd74
This lock is redundant now?
zadjii-msft f355f88
Create a control unittesting project
zadjii-msft 78bd806
Need settings to instantiate controls
zadjii-msft 8c5faba
Successfully create an instance of ControlCore in the tests
zadjii-msft ae4d2f2
Start writing real tests for all this, which is just about insane
zadjii-msft fbc3175
And interactivity tests!
zadjii-msft c37c073
Fix mousewheeling opactiy in the control
zadjii-msft 5591ef0
Taking this lock is redundant now? It causes a deadlock?
zadjii-msft 6dfa1b6
Fiz the scrollbar
zadjii-msft ff8cd22
Whoop, a test for mouse scrolling!
zadjii-msft 01d248f
Yank the PointerPoint from the function signature
zadjii-msft 8216c55
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 3cbf377
Fix the tests after the merge
zadjii-msft f959612
A test for #9725
zadjii-msft f5f9de2
Fix a double free when closing the terminal
zadjii-msft 832bb66
move around the read only warning. Now, does it work?
zadjii-msft 8bd5bb0
Convert ControlCore's privates to _camelCase
zadjii-msft 61e91f6
Same deal, _camelCase the privates of ControlInteractivity
zadjii-msft 06a9a10
Fix read-only mode
zadjii-msft 198576a
Okay, this clearly isn't working. WTF did I do wrong?
zadjii-msft f057930
Revert "Okay, this clearly isn't working. WTF did I do wrong?"
zadjii-msft 15b9936
These are all unnecessary, and might be slowing our builds down!
zadjii-msft 021dc57
This is how the original taskbar update worked, which turns out, does…
zadjii-msft be80583
Revert "This is how the original taskbar update worked, which turns o…
zadjii-msft 4189bb0
Okay, this clearly isn't working. WTF did I do wrong?
zadjii-msft d8beada
This fixes #9743, but I think I'm still doing something off the UI th…
zadjii-msft a34cc1a
I did forget the co_await after all.
zadjii-msft fa0897a
Get rid of some TODOs
zadjii-msft 643f1b7
Oh my, the last of the TODO!s
zadjii-msft 5dc1632
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 4e8dace
Fix my font loading bug
zadjii-msft 1ed1781
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft f3ea7c1
fix some unit tests
zadjii-msft ac683c1
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 1488079
Some cleanup for review
zadjii-msft fd8314e
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft c14bdd6
what? I'm not just guessing at the compiler error rather than buildin…
zadjii-msft 668fab4
nits from carlos
zadjii-msft 69f22a7
hot reload anti-aliasing
zadjii-msft c113b65
Revert "Use DComp surface handle for Swap Chain management."
zadjii-msft bddae1c
make_self for fun and profit
zadjii-msft 0e72f77
woah look, none of these tests were ever running :yikes:
zadjii-msft e271bdf
the really easy feedback from dustin
zadjii-msft 0d78c16
some minor renames
zadjii-msft 5b5ac1b
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft e2499a4
Change the paste handler to a wstring_view
zadjii-msft 03949ac
get rid of unnecessary `focused` param
zadjii-msft 85fc41a
A pile of nits
zadjii-msft e6f93ba
a TON of `til::point`s
zadjii-msft 6e47221
another pile of nits
zadjii-msft 3cc4717
bunch of comments
zadjii-msft 753ca1b
patch the tests up to not use Cascadia Mono anymore
zadjii-msft 144d95a
punt this test to future me in #7001
zadjii-msft 11cc17c
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 65b84ff
I think this is the last of the 'trivial' notes. I still have to do t…
zadjii-msft 6d5351e
This is all the major blockers IMO. not like anyone will review it wh…
zadjii-msft efbec1f
Leonard is right, this is better
zadjii-msft 0f62cea
LOAD BEARING COMMIT
zadjii-msft 88742d6
Merge remote-tracking branch 'origin/main' into dev/migrie/oop-core-i…
zadjii-msft 9731636
an update from main
zadjii-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -996,9 +996,6 @@ namespace winrt::TerminalApp::implementation | |
|
|
||
| term.OpenHyperlink({ this, &TerminalPage::_OpenHyperlinkHandler }); | ||
|
|
||
| // Add an event handler for when the terminal wants to set a progress indicator on the taskbar | ||
| term.SetTaskbarProgress({ this, &TerminalPage::_SetTaskbarProgressHandler }); | ||
|
|
||
| term.HidePointerCursor({ get_weak(), &TerminalPage::_HidePointerCursorHandler }); | ||
| term.RestorePointerCursor({ get_weak(), &TerminalPage::_RestorePointerCursorHandler }); | ||
|
|
||
|
|
@@ -1053,6 +1050,11 @@ namespace winrt::TerminalApp::implementation | |
| } | ||
| }); | ||
|
|
||
| // Add an event handler for when the terminal or tab wants to set a | ||
| // progress indicator on the taskbar | ||
| hostingTab.TaskbarProgressChanged({ get_weak(), &TerminalPage::_SetTaskbarProgressHandler }); | ||
| term.SetTaskbarProgress({ get_weak(), &TerminalPage::_SetTaskbarProgressHandler }); | ||
|
|
||
| // TODO GH#3327: Once we support colorizing the NewTab button based on | ||
| // the color of the tab, we'll want to make sure to call | ||
| // _ClearNewTabButtonColor here, to reset it to the default (for the | ||
|
|
@@ -1154,7 +1156,7 @@ namespace winrt::TerminalApp::implementation | |
| { | ||
| // The magic value of WHEEL_PAGESCROLL indicates that we need to scroll the entire page | ||
| realRowsToScroll = _systemRowsToScroll == WHEEL_PAGESCROLL ? | ||
| terminalTab->GetActiveTerminalControl().GetViewHeight() : | ||
| terminalTab->GetActiveTerminalControl().ViewHeight() : | ||
| _systemRowsToScroll; | ||
| } | ||
| else | ||
|
|
@@ -1295,7 +1297,7 @@ namespace winrt::TerminalApp::implementation | |
| if (const auto terminalTab{ _GetFocusedTabImpl() }) | ||
| { | ||
| const auto control = _GetActiveControl(); | ||
| const auto termHeight = control.GetViewHeight(); | ||
| const auto termHeight = control.ViewHeight(); | ||
| auto scrollDelta = _ComputeScrollDelta(scrollDirection, termHeight); | ||
| terminalTab->Scroll(scrollDelta); | ||
| } | ||
|
|
@@ -1647,29 +1649,37 @@ namespace winrt::TerminalApp::implementation | |
| return false; | ||
| } | ||
|
|
||
| void TerminalPage::_ControlNoticeRaisedHandler(const IInspectable /*sender*/, const Microsoft::Terminal::Control::NoticeEventArgs eventArgs) | ||
| // Important! Don't take this eventArgs by reference, we need to extend the | ||
| // lifetime of it to the other side of the co_await! | ||
| winrt::fire_and_forget TerminalPage::_ControlNoticeRaisedHandler(const IInspectable /*sender*/, | ||
| const Microsoft::Terminal::Control::NoticeEventArgs eventArgs) | ||
|
Comment on lines
+1654
to
+1655
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you make this method resistant against being called from a background thread you don't need to switch into the foreground thread in neither |
||
| { | ||
| winrt::hstring message = eventArgs.Message(); | ||
| auto weakThis = get_weak(); | ||
| co_await winrt::resume_foreground(Dispatcher()); | ||
| if (auto page = weakThis.get()) | ||
| { | ||
| winrt::hstring message = eventArgs.Message(); | ||
|
|
||
| winrt::hstring title; | ||
| winrt::hstring title; | ||
|
|
||
| switch (eventArgs.Level()) | ||
| { | ||
| case NoticeLevel::Debug: | ||
| title = RS_(L"NoticeDebug"); //\xebe8 | ||
| break; | ||
| case NoticeLevel::Info: | ||
| title = RS_(L"NoticeInfo"); // \xe946 | ||
| break; | ||
| case NoticeLevel::Warning: | ||
| title = RS_(L"NoticeWarning"); //\xe7ba | ||
| break; | ||
| case NoticeLevel::Error: | ||
| title = RS_(L"NoticeError"); //\xe783 | ||
| break; | ||
| } | ||
| switch (eventArgs.Level()) | ||
| { | ||
| case NoticeLevel::Debug: | ||
| title = RS_(L"NoticeDebug"); //\xebe8 | ||
| break; | ||
| case NoticeLevel::Info: | ||
| title = RS_(L"NoticeInfo"); // \xe946 | ||
| break; | ||
| case NoticeLevel::Warning: | ||
| title = RS_(L"NoticeWarning"); //\xe7ba | ||
| break; | ||
| case NoticeLevel::Error: | ||
| title = RS_(L"NoticeError"); //\xe783 | ||
| break; | ||
| } | ||
|
|
||
| _ShowControlNoticeDialog(title, message); | ||
| page->_ShowControlNoticeDialog(title, message); | ||
| } | ||
| } | ||
|
|
||
| void TerminalPage::_ShowControlNoticeDialog(const winrt::hstring& title, const winrt::hstring& message) | ||
|
|
@@ -1707,8 +1717,9 @@ namespace winrt::TerminalApp::implementation | |
| // Arguments: | ||
| // - sender (not used) | ||
| // - eventArgs: the arguments specifying how to set the progress indicator | ||
| void TerminalPage::_SetTaskbarProgressHandler(const IInspectable /*sender*/, const IInspectable /*eventArgs*/) | ||
| winrt::fire_and_forget TerminalPage::_SetTaskbarProgressHandler(const IInspectable /*sender*/, const IInspectable /*eventArgs*/) | ||
| { | ||
| co_await resume_foreground(Dispatcher()); | ||
| _SetTaskbarProgressHandlers(*this, nullptr); | ||
| } | ||
|
|
||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.