[PR #10184] [MERGED] Switch Connections to use ValueSets to initialize them #27947

Open
opened 2026-01-31 09:25:20 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10184
Author: @zadjii-msft
Created: 5/25/2021
Status: Merged
Merged: 7/20/2021
Merged by: @undefined

Base: mainHead: dev/migrie/oop/connection-factory-rebase


📝 Commits (10+)

  • e4478ee Only access ControlInteractivity through the projection
  • 400b35f Only 24 more errors to go
  • 42b970b Totally upend the control AutomationPeer workings
  • 4578c13 some comments that should have been in the previous commit. 16 errors remain.
  • d8cc047 GetHoveredCell/UpdateHoveredCell. 12 remain.
  • 21a97b6 Revert "Revert "Use DComp surface handle for Swap Chain management.""
  • 2e861d8 some minor cleanup
  • e20caae Merge branch 'dev/migrie/f/oop/use-dcomp-handle' into dev/migrie/interactivity-projection-000
  • d667f3b Use the HANDLE for the swapchainin the core projection
  • 62cbf30 it builds and runs so I guess it's done now

📊 Changes

24 files changed (+304 additions, -79 deletions)

View changed files

📝 scratch/ScratchIslandApp/SampleApp/MyPage.cpp (+15 -8)
📝 scratch/ScratchIslandApp/SampleApp/MyPage.xaml (+9 -4)
📝 scratch/ScratchIslandApp/SampleApp/MySettings.h (+10 -3)
📝 scratch/ScratchIslandApp/SampleApp/dll/SampleApp.vcxproj (+4 -0)
📝 src/cascadia/TerminalApp/DebugTapConnection.cpp (+1 -0)
📝 src/cascadia/TerminalApp/DebugTapConnection.h (+1 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+16 -15)
📝 src/cascadia/TerminalAzBridge/main.cpp (+5 -1)
📝 src/cascadia/TerminalAzBridge/pch.h (+1 -0)
📝 src/cascadia/TerminalConnection/AzureConnection.cpp (+6 -4)
📝 src/cascadia/TerminalConnection/AzureConnection.h (+3 -1)
📝 src/cascadia/TerminalConnection/AzureConnection.idl (+1 -1)
src/cascadia/TerminalConnection/ConnectionInformation.cpp (+66 -0)
src/cascadia/TerminalConnection/ConnectionInformation.h (+43 -0)
src/cascadia/TerminalConnection/ConnectionInformation.idl (+17 -0)
📝 src/cascadia/TerminalConnection/ConptyConnection.cpp (+62 -26)
📝 src/cascadia/TerminalConnection/ConptyConnection.h (+18 -15)
📝 src/cascadia/TerminalConnection/ConptyConnection.idl (+9 -1)
📝 src/cascadia/TerminalConnection/EchoConnection.h (+2 -0)
📝 src/cascadia/TerminalConnection/ITerminalConnection.idl (+2 -0)

...and 4 more files

📄 Description

⚠️ targets #10051

Summary of the Pull Request

This PR does one big, primary thing. It removes all the constructors from any TerminalConnections, and changes them to use an Initialize method that accepts a ValueSet of properties.

Why?

For the upcoming window/content process work, we'll need the content process to be able to initialize the connection in the content process. However, the window process will be the one that knows what type of connection to make. Enter ConnectionInformation. This class will let us specify the class name of the type we want to create, and a set of settings to use when initializing that connection.

IMPORTANT: As a part of this, the constructor for a connection must have 0 arguments. RoActivateInstance lets you just conjure a WinRT type just by class name, but that class must have a 0 arg ctor. Hence the need for Initialize, to actually pass the settings.

We're using a ValueSet here because it's basically a json blob, with more steps. In the future, when extension authors want to have custom connections, we can always deserialize the json into a ValueSet, pass it to their connection's Initialize, and let then get what they need out of it.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

ConnectionInformation was included as a part of this PR, to demonstrate how this will eventually be used. ConnectionInformation is not currently used.

Validation Steps Performed

It still builds and runs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10184 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 5/25/2021 **Status:** ✅ Merged **Merged:** 7/20/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/oop/connection-factory-rebase` --- ### 📝 Commits (10+) - [`e4478ee`](https://github.com/microsoft/terminal/commit/e4478eec6afa26b0f9d401e80195b527471a1005) Only access ControlInteractivity through the projection - [`400b35f`](https://github.com/microsoft/terminal/commit/400b35f8140732aa8483f6a90c09ad225a93581c) Only 24 more errors to go - [`42b970b`](https://github.com/microsoft/terminal/commit/42b970b7f22248bb17dd295011ce6a5ff5a064cf) Totally upend the control AutomationPeer workings - [`4578c13`](https://github.com/microsoft/terminal/commit/4578c136a054a1efc50e99264a555547a909fda1) some comments that should have been in the previous commit. 16 errors remain. - [`d8cc047`](https://github.com/microsoft/terminal/commit/d8cc047a7ef39d93430bc724e8071e3568cd4dc6) GetHoveredCell/UpdateHoveredCell. 12 remain. - [`21a97b6`](https://github.com/microsoft/terminal/commit/21a97b6c80dd95cf3be84d9eb2070adc5956fa75) Revert "Revert "Use DComp surface handle for Swap Chain management."" - [`2e861d8`](https://github.com/microsoft/terminal/commit/2e861d8a37886278e638c556b71e44943d6b64b7) some minor cleanup - [`e20caae`](https://github.com/microsoft/terminal/commit/e20caae758319433196b4baa4cf6a06354801e05) Merge branch 'dev/migrie/f/oop/use-dcomp-handle' into dev/migrie/interactivity-projection-000 - [`d667f3b`](https://github.com/microsoft/terminal/commit/d667f3b63340b6db35a30e141c75bdecb6931ad0) Use the HANDLE for the swapchainin the core projection - [`62cbf30`](https://github.com/microsoft/terminal/commit/62cbf30782fd8439d755226c43ed7d366748aa94) it builds and runs so I guess it's done now ### 📊 Changes **24 files changed** (+304 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `scratch/ScratchIslandApp/SampleApp/MyPage.cpp` (+15 -8) 📝 `scratch/ScratchIslandApp/SampleApp/MyPage.xaml` (+9 -4) 📝 `scratch/ScratchIslandApp/SampleApp/MySettings.h` (+10 -3) 📝 `scratch/ScratchIslandApp/SampleApp/dll/SampleApp.vcxproj` (+4 -0) 📝 `src/cascadia/TerminalApp/DebugTapConnection.cpp` (+1 -0) 📝 `src/cascadia/TerminalApp/DebugTapConnection.h` (+1 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+16 -15) 📝 `src/cascadia/TerminalAzBridge/main.cpp` (+5 -1) 📝 `src/cascadia/TerminalAzBridge/pch.h` (+1 -0) 📝 `src/cascadia/TerminalConnection/AzureConnection.cpp` (+6 -4) 📝 `src/cascadia/TerminalConnection/AzureConnection.h` (+3 -1) 📝 `src/cascadia/TerminalConnection/AzureConnection.idl` (+1 -1) ➕ `src/cascadia/TerminalConnection/ConnectionInformation.cpp` (+66 -0) ➕ `src/cascadia/TerminalConnection/ConnectionInformation.h` (+43 -0) ➕ `src/cascadia/TerminalConnection/ConnectionInformation.idl` (+17 -0) 📝 `src/cascadia/TerminalConnection/ConptyConnection.cpp` (+62 -26) 📝 `src/cascadia/TerminalConnection/ConptyConnection.h` (+18 -15) 📝 `src/cascadia/TerminalConnection/ConptyConnection.idl` (+9 -1) 📝 `src/cascadia/TerminalConnection/EchoConnection.h` (+2 -0) 📝 `src/cascadia/TerminalConnection/ITerminalConnection.idl` (+2 -0) _...and 4 more files_ </details> ### 📄 Description #### ⚠️ targets #10051 ## Summary of the Pull Request This PR does one big, primary thing. It removes all the constructors from any TerminalConnections, and changes them to use an `Initialize` method that accepts a `ValueSet` of properties. Why? For the upcoming window/content process work, we'll need the content process to be able to initialize the connection _in the content process_. However, the window process will be the one that knows what type of connection to make. Enter `ConnectionInformation`. This class will let us specify the class name of the type we want to create, and a set of settings to use when initializing that connection. **IMPORTANT**: As a part of this, the constructor for a connection must have 0 arguments. `RoActivateInstance` lets you just conjure a WinRT type just by class name, but that class must have a 0 arg ctor. Hence the need for `Initialize`, to actually pass the settings. We're using a `ValueSet` here because it's basically a json blob, with more steps. In the future, when extension authors want to have custom connections, we can always deserialize the json into a `ValueSet`, pass it to their connection's `Initialize`, and let then get what they need out of it. ## References * 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-50760298 * [x] I work here * [n/a] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments `ConnectionInformation` was included as a part of this PR, to demonstrate how this will eventually be used. `ConnectionInformation` is not _currently_ used. ## Validation Steps Performed It still builds and runs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:25:20 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27947