Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5ef9462
ControlCore: Add some support methods for HWND boot
DHowett Oct 13, 2026
4ef8a79
Replace HwndTerminal with FlatC
DHowett Oct 13, 2026
d77e9b2
FlatC: add a11y and TSF
DHowett Oct 13, 2026
a652288
spelling
DHowett Oct 16, 2026
df7d5ce
Revert some of the spelling fixes which broke the code in other ways
DHowett Oct 19, 2026
cde7432
spell: use the real types
DHowett Oct 19, 2026
a4cbab2
Slightly better namespacing to fix spell issues
DHowett Oct 19, 2026
86b388c
Rewrite HwndTerminal to build on ControlInteractivity and -Core
DHowett Oct 19, 2026
29e424f
Ah, well
DHowett Oct 19, 2026
537d303
SelectedText hasn't returned a vector since #16377
DHowett Oct 20, 2026
0b71160
Sort various function tables
DHowett Oct 20, 2026
fd8196a
Un-windows7-ize TermControl
DHowett Oct 20, 2026
6626d48
fix function pointer names and prototypes
DHowett Oct 20, 2026
dcbdd3c
sort includes hopefully this doesn't explode
DHowett Oct 20, 2026
d0be621
vertical spacing
DHowett Oct 20, 2026
fe3a959
no redirection bitmap i guess
DHowett Oct 20, 2026
982767a
I guess whack some window flags
DHowett Oct 20, 2026
3f0bb9a
Better order the members
DHowett Oct 20, 2026
22a6415
Move PWRITECB to data,len
DHowett Oct 20, 2026
75a5021
be much less clever
DHowett Oct 20, 2026
16b8029
Remove UserScrolled as it's unused at this layer; TerminalScrolled co…
DHowett Oct 20, 2026
2377560
Rework cursor styles
DHowett Oct 20, 2026
5ba7b40
UN-fix that
DHowett Oct 20, 2026
8bb7d9d
okay the TAB thing is weird
DHowett Oct 20, 2026
2ce57ef
Don't forward characters generated by keys ControlCore already handled
DHowett Oct 20, 2026
a40d49d
More reviews
DHowett Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/spelling/allow/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ICONINFO
IDirect
IInheritable
imm
INCONTACT
iosfwd
isa
isspace
Expand Down Expand Up @@ -124,6 +125,9 @@ PATINVERT
PICKFOLDERS
PINPUT
pmr
PSCROLLCB
PTERM
PWRITECB
QUERYENDSESSION
rcx
REGCLS
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ pvar
pwch
PWDDMCONSOLECONTEXT
pws
pwstr
PWSTR
pwsz
pythonw
QUERYOPEN
Expand Down
36 changes: 36 additions & 0 deletions src/cascadia/TerminalControl/ControlCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,22 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return true;
}

bool ControlCore::InitializeWithHwnd(const float actualWidth,
const float actualHeight,
const float compositionScale,
const uint64_t hwnd)
{
_owningHwnd = hwnd;

auto i = Initialize(actualWidth, actualHeight, compositionScale);
if (i)
{
auto lock = _terminal->LockForWriting();
(void)_renderEngine->SetHwnd(reinterpret_cast<HWND>(hwnd));
}
return i;
}

// Method Description:
// - Tell the renderer to start painting.
// - !! IMPORTANT !! Make sure that we've attached our swap chain to an
Expand Down Expand Up @@ -3018,4 +3034,24 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
_renderer->StopTimer(h);
}

winrt::Windows::Foundation::Size ControlCore::RenderedSize()
{
return { _panelWidth, _panelHeight };
}

void ControlCore::ResizeToDimensions(uint32_t width, uint32_t height, winrt::Windows::Foundation::Size& newSizeInPixels)
{
if (!_renderEngine)
{
throw winrt::hresult_error(E_INVALIDARG);
}
auto pixelSize = _renderEngine->GetViewportInPixels(Viewport::FromDimensions({ 0, 0 }, til::size{ static_cast<til::CoordType>(width), static_cast<til::CoordType>(height) }));
SizeOrScaleChanged(static_cast<float>(pixelSize.Width()) / _compositionScale, static_cast<float>(pixelSize.Height()) / _compositionScale, _compositionScale);
auto newSize = RenderedSize();
newSizeInPixels = {
newSize.Width * _compositionScale,
newSize.Height * _compositionScale,
};
}
}
7 changes: 7 additions & 0 deletions src/cascadia/TerminalControl/ControlCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
bool Initialize(const float actualWidth,
const float actualHeight,
const float compositionScale);
bool InitializeWithHwnd(const float actualWidth,
const float actualHeight,
const float compositionScale,
const uint64_t hwnd);
void EnablePainting();

void Detach();
Expand Down Expand Up @@ -264,6 +268,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
bool ShouldShowSelectCommand();
bool ShouldShowSelectOutput();

winrt::Windows::Foundation::Size RenderedSize();
void ResizeToDimensions(uint32_t width, uint32_t height, winrt::Windows::Foundation::Size& newSizeInPixels);

void PreviewInput(std::wstring_view input);

using TimerHandle = ::Microsoft::Console::Render::TimerHandle;
Expand Down
Loading
Loading