Eliminate the DispatchCommon class (#12389)

## Summary of the Pull Request

Other than the `s_ResizeWindow` function, the `DispatchCommon` class was
just a couple of static functions indirectly calling the `ConGetSet`
interface. So by moving the `s_ResizeWindow` implementation into the
`ConhostInternalGetSet` class, we could easily replace all usage of
`DispatchCommon` with direct calls to `ConGetSet`.

## PR Checklist
* [x] Closes #12253
* [x] CLA signed.
* [ ] Tests added/passed
* [ ] Documentation updated.
* [ ] Schema updated.
* [x] I've discussed this with core contributors already. Issue number
where discussion took place: #12253

## Validation Steps Performed

I've manually confirmed the resizing operations still work as expected.
The other functions are harder to test, but were trivial replacements.
This commit is contained in:
James Holderness
2022-02-09 11:56:23 +00:00
committed by GitHub
parent 1870feeca3
commit d63ab27c0c
14 changed files with 60 additions and 136 deletions

View File

@@ -8,7 +8,6 @@
#include "output.h"
#include "handle.h"
#include "../interactivity/inc/ServiceLocator.hpp"
#include "../terminal/adapter/DispatchCommon.hpp"
using namespace Microsoft::Console;
using namespace Microsoft::Console::Interactivity;
@@ -137,9 +136,9 @@ void PtySignalInputThread::ConnectConsole() noexcept
// - <none>
void PtySignalInputThread::_DoResizeWindow(const ResizeWindowData& data)
{
if (DispatchCommon::s_ResizeWindow(*_pConApi, data.sx, data.sy))
if (_pConApi->ResizeWindow(data.sx, data.sy))
{
DispatchCommon::s_SuppressResizeRepaint(*_pConApi);
_pConApi->SuppressResizeRepaint();
}
}