Commit graph

2278 commits

Author SHA1 Message Date
Dustin L. Howett 88dce53cc8 Migrate spelling-0.0.19 changes from main 2021-05-14 11:51:48 -05:00
Mike Griese baf97f192c cleanup 2021-05-14 11:51:48 -05:00
Mike Griese 20364acc7c looks like scrolling is back on the menu boys. 16.243s vs 16.035s in-proc vs out, so I'm gonna say there's not a substantial regression here, whoop whoop 2021-05-14 11:22:24 -05:00
Mike Griese a662628f43 This gets rid of the output one, which I was the MOST worried about. Still worried about the scrollbar one though. In release, we're getting 16.849s vs 16.378s for in-proc vs oop 2021-05-14 10:14:33 -05:00
Mike Griese bc09df152e found a way to have dispatchers inside ControlCore, in the content process 2021-05-14 09:10:27 -05:00
Mike Griese 815cfb846b Merge branch 'dev/migrie/oop/the-whole-thing' into dev/migrie/oop/connection-factory 2021-05-13 08:48:24 -05:00
Mike Griese 8bb1afca04 Merge remote-tracking branch 'origin/dev/migrie/oop/sample-project' into dev/migrie/oop/the-whole-thing 2021-05-13 08:47:56 -05:00
Mike Griese 6cc9f37098 make spellbot happy 2021-05-13 08:33:05 -05:00
Mike Griese 4a66f61c6e Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project 2021-05-13 08:27:03 -05:00
Mike Griese ff3b808dfb this is almost exclusively nits 2021-05-13 08:25:36 -05:00
Mike Griese 6f07004f39 some consts 2021-05-13 07:39:23 -05:00
Mike Griese 59e911d569 minor typo cleanup 2021-05-13 07:29:10 -05:00
Mike Griese 4efdf39254 This fixes nvda, so nowwe just have to polish 2021-05-13 05:53:20 -05:00
Mike Griese 21a6370ec5 fix the tests 2021-05-12 13:52:32 -05:00
Mike Griese 086710aaba Merge remote-tracking branch 'origin/main' into dev/migrie/interactivity-projection-000 2021-05-12 12:26:46 -05:00
Mike Griese 9f45963e73
Use DComp surface handle for Swap Chain management (#10023)
## Summary of the Pull Request

This PR changes the DxEngine to create a swapchain HANDLE, then have the TermControl attach _that_ handle to the SwapChainPanel, rather than returning the swapchain via a `IDXGISwapChain1`.

I didn't write this code originally, @miniksa helped me out. The original commit was so succinct that I didn't think there was anything else to add or take away.

I'm going to need this for tear-out (#1256), so that I can have the content process create swap chain handles, then duplicate those handles out to the window process that will end up embedding the content.

## References

* [`DCompositionCreateSurfaceHandle`](https://docs.microsoft.com/en-us/windows/win32/api/dcomp/nf-dcomp-dcompositioncreatesurfacehandle)
* [`CreateSwapChainForCompositionSurfaceHandle`](https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_3/nf-dxgi1_3-idxgifactorymedia-createswapchainforcompositionsurfacehandle)
* [`CreateSwapChainForComposition`](https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgifactory2-createswapchainforcomposition)
* Tear-out: #1256
* Megathread: #5000
* Project: https://github.com/microsoft/terminal/projects/5

## PR Checklist
* [x] Closes https://github.com/microsoft/terminal/projects/5#card-50760249
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

This reverts commit c113b65d9b.

That commit reverted 30b8335479

## Validation Steps Performed

* [x] Built and ran the Terminal, it still seems to work
* [x] Does a TDR still work? or do we need to recreate the handle, or something.
* [x] Does this work on Win7? I honestly have no idea how DX compatibility works. Presumably, the WPF version uses the `ForHwnd` path, so this will still work, but I don't know if this will suddenly fail to launch on Win7 or something. Tagging in @miniksa.
2021-05-12 11:54:17 -05:00
Dustin L. Howett e0bd76b30d
Make sure we run CG component detection on main (#10078)
I believe that there is a hidden "default branch" setting in Azure
DevOps, and ours is set to "master". CG only attempts to automatically
inject to builds off the default branch... and because we're a GitHub
repo running builds in AzDO we _can't change what the default branch
is_. Oops.
2021-05-12 02:47:45 +00:00
Mike Griese 8564b269c4
In specific scenarios, focus the active control (#10048)
A redo of #6290. That PR was overkill. In that one, we'd toss focus back to the active control any time that the tab view item got focus. That's maybe not the _best_ solution.

Instead, this PR is precision strikes. We're re-using a lot of what we already have from #9260. 
* When the context menu is closed, yeet focus to the control.
* When the renamer is dismissed, yeet focus to the control.
* When the TabViewItem is tapped (meaning no one else handled it), yeet focus to the control.

### checklist 
* [x] I work here
* [ ] This is UI so it doesn't have tests
* [x] Closes #3609
* [x] Closes #5750
* [x] Closes #6680

### scenarios:

* [x] focus the window by clicking on the tab -> Control is focused. 
* [x] Open the color picker with the context menu, can move the focus inside the picker with the arrow keys.
* [x] Dismiss the picker with esc -> Control is focused. 
* [x] Dismiss the picker with enter -> Control is focused. 
* [x] Dismiss the renamer with esc -> Control is focused. 
* [x] Dismiss the renamer with enter -> Control is focused. 
* [x] Dismiss the context menu with esc -> Control is focused. 
* [x] Start renaming, then click on the tab -> Rename is committed, Control is focused. 
* [x] Start renaming, then click on the text box -> focus is still in the text box
2021-05-11 23:55:49 +00:00
Dustin L. Howett 258a6ce8a1
Add a test for GH-9692/MSFT-33127449 (#10077)
This test has some load bearing specifics in it.

In short, it must trigger multiple boost::small_vector growths. The
vector is reused for the lifetime of the console (!) so it must be
forced to act the way the repro requires.

Oh, and the test needs to be run with Application Verifier +Heap.

This validates the fix in c0ab9cb5b5.
2021-05-11 23:16:39 +00:00
Leonard Hecker 43040ef9d0
Fix crash on exit introduced in ac265aa (#10042)
## Summary of the Pull Request

ControlCore::AttachUiaEngine receives a IRenderEngine as a raw pointer,
which TermControl owns. We must ensure that we first destroy the
ControlCore before the UiaEngine instance (both owned by TermControl).
Otherwise a deallocated IRenderEngine is accessed when
ControlCore calls Renderer::TriggerTeardown.

## References

This crash was introduced in #10031.

## PR Checklist
* [x] I work here
* [x] Tests added/passed

## Validation Steps Performed

* Run accevent.exe to cause a UiaEngine to be attached to a TermControl.
* Close the current tab
* Ensured no crashes occur
2021-05-11 23:03:08 +00:00
Mike Griese d368fded4f Comment out these events, becasue they're hella slow. We'll have to replace them 2021-05-11 16:48:12 -05:00
Mike Griese 1acb938e4a Well, the connection is out of proc, but the callbacks to the UI process are **P A I N** 2021-05-11 14:38:55 -05:00
Dustin Howett 440b626ee3 Revert "Initial implementation of fine-grained text analysis (#9202)"
This reverts commit 1c414a7723.

Fixes #10034.
2021-05-11 14:14:17 -05:00
Mike Griese 2e0553c3d9 I really hate this whole 'you can't have two methods with the same number of args' crap. Makes this way harder. Clearly, what I did here is still in-proc 2021-05-11 12:38:31 -05:00
Dustin Howett b132fbe4a6 Merge remote-tracking branch 'openconsole/inbox' into HEAD 2021-05-11 12:11:27 -05:00
Mike Griese bdf8006f4a Change TermControl to beable to do the in-proc connection creation, probably? 2021-05-11 11:59:39 -05:00
Dustin Howett c0ab9cb5b5 Merged PR 6034984: Fix a crash caused by improper buffer management w/ multiple clients
Until there's a "Wait", there's usually only one API message inflight at
a time.

In our quest for performance, we put that single API message in charge
of its own buffer management: instead of allocating buffers on the heap
and deleting them later (storing pointers to them at the far corners of
the earth), it would instead allocate them from small internal pools (if
possible) and only heap allocate (transparently) if necessary. The
pointers flung to the corners of the earth would be pointers (1) back
into the API_MSG or (2) to a heap block owned by boost::small_vector.

It took us months to realize that those bare pointers were being held by
COOKED_READ and RAW_READ and not actually being updated when the API
message was _copied_ as it was shuffled off to the background to become
a "Wait" message.

It turns out that it's trivially possible to crash the console by
sending two API calls--one that waits and one that completes
immediately--when the waiting message or the "wait completer" has a
bunch of dangling pointers in it. It further turns out that some
accessibility software (like JAWS) attaches directly to the console
session, much like winpty and ConEmu and friends. They're trying to read
out the buffer (API call!) and sometimes there's a shell waiting for
input (API call!). Oops.

In this commit, we fix up the message's internal pointers (in lieu of
giving it a proper copy constructor; see GH-10076) and then tell the
wait completion routine (which is going to be a COOKED_READ, RAW_READ,
DirectRead or WriteData) about the new buffer location.

This is a scoped fix that should be replaced (TODO GH-10076) with a
final one after Ask mode.

Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_wdx_dxp_windev eca0875950fd3a9735662474613405e2dc06f485

References GH-10076

Fixes MSFT-33127449
Fixes GH-9692
2021-05-11 16:56:43 +00:00
Dustin Howett 563e20b25e Merged PR 6013951: Reflect OS build changes for "Implicit Binary Deps" rollout
The ES folks removed support for implicit binary dependencies in test projects, which required our testmd to change to include its dependency on testnetv5.

Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_wdx_dxp_windev a2a74747feda018c347ba787e166e8385bb17e47

Related work items: MSFT-31480819
2021-05-11 16:46:37 +00:00
Mike Griese 9fb87b3a98 Add IConnectionSettings, so connections can get their settings from another object, not necessarily the ctor 2021-05-11 09:30:43 -05:00
Mike Griese de982695b1 proof of concept using RoActivateClass to create a connection by string 2021-05-10 16:45:54 -05:00
Mike Griese 160533a427 this being missing was breaking the build 2021-05-10 16:41:12 -05:00
Mike Griese 4cbc522a8d Merge branch 'dev/migrie/oop/sample-project' into dev/migrie/oop/the-whole-thing 2021-05-10 11:15:34 -05:00
Mike Griese 6e3fadda66 Some cleanup for review 2021-05-10 07:58:19 -05:00
Mike Griese 71d445b7aa Add updates to the project from dev/migrie/oop/the-whole-thing 2021-05-10 07:21:49 -05:00
Mike Griese 07c731d06f Merge branch 'dev/migrie/interactivity-projection-000' into dev/migrie/oop/sample-project 2021-05-10 06:58:36 -05:00
Mike Griese b7b23a8e7d god I knew I left these behind 2021-05-07 11:29:07 -05:00
Mike Griese e340fe95c2 Merge branch 'dev/migrie/f/oop/use-dcomp-handle' into dev/migrie/interactivity-projection-000 2021-05-07 11:25:36 -05:00
Mike Griese 12b78f5066 Merge remote-tracking branch 'origin/main' into dev/migrie/f/oop/use-dcomp-handle 2021-05-07 11:25:08 -05:00
Mike Griese dace0c4cf7 a bit more cleanup 2021-05-07 11:24:47 -05:00
Mike Griese 08694567ff Some cleanup 2021-05-07 11:16:16 -05:00
Mike Griese 47410c9efb now this works! 2021-05-07 11:08:26 -05:00
Mike Griese 6e031e5257 I want to get the padding out of interactivity, but the control bounds are still wrong 2021-05-07 10:51:55 -05:00
Mike Griese 5e7d270fa2 Merge remote-tracking branch 'origin/main' into dev/migrie/interactivity-projection-000
# Conflicts:
#	src/cascadia/TerminalControl/ControlInteractivity.cpp
#	src/cascadia/TerminalControl/ControlInteractivity.h
#	src/cascadia/TerminalControl/TermControl.cpp
#	src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp
2021-05-07 09:50:07 -05:00
Mike Griese 03fb764d58 fix accessibility 2021-05-07 05:52:12 -05:00
Mike Griese a1ce7cb077 What a ridiculous hack 2021-05-07 05:41:03 -05:00
kovdu 0e8d5f24c4
Keep the last selected pivot active when navigating over profile pages (#10047)
## PR Checklist
* [x] Closes #9920 
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA

## Validation Steps Performed

- When opening a profile page and selecting a random pivot, when then navigating away from the profile page to another item and navigating back to the same profile the last selected pivot was still active.
- When opening a profile page and selecting a random pivot, when then navigating away from the profile page to a second profile the last selected pivot was immediately active on the second profile.
- When selecting random pivots and navigating only between other profile pages the last selected pivot was always active on the opened profile page.

What felt a bit strange at first sight was:
- open a profile page, select a random pivot
- start adding a new profile
- the last selected pivot is immediately active and not the "General" pivot what might be the obvious pivot to show when a user  wants to add a new profile.

After playing a bit more with this this started to feel ok. Since as a user you might go to "Add new profile" immediately anyway instead of opening other profiles first.  

Just explicitly highlighting this last point since maybe someone prefers that we need to make sure to always start with the 'General' pivot when adding a new profile and then this fix is not correct.
2021-05-07 04:13:06 +00:00
PankajBhojwani b3775bc2b0
[Conpty] Pass through request for mouse mode to the Terminal (#9970)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
When the client application sets the console input mode with the `ENABLE_MOUSE_INPUT` flag, we send along the appropriate VT sequences to the connected terminal (if there is one).

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References
#376 
#6859 

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [ ] Closes #xxx
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [x] I work here

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Far manager works
2021-05-07 02:46:11 +00:00
Mike Griese 13767210c9 Merge branch 'dev/migrie/f/oop/use-dcomp-handle' into dev/migrie/interactivity-projection-000 2021-05-06 15:41:08 -05:00
Mike Griese 445bdf6cad Do the delayload dance 2021-05-06 10:00:29 -05:00
Mike Griese 7654de9c31 MIght have accidentally broke razzle.cmd here 2021-05-06 07:53:11 -05:00