Skip to content

Commit

Permalink
remove duplicate TerminalInput. Always use the InputBuffer's
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Mar 10, 2020
1 parent 82f1895 commit 55a6cee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/host/getset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ void DoSrvPrivateTabClear(const bool fClearAll)
void DoSrvPrivateEnableVT200MouseMode(const bool fEnable)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.terminalMouseInput.EnableDefaultTracking(fEnable);
gci.GetActiveInputBuffer()->GetTerminalInput().EnableDefaultTracking(fEnable);
}

// Routine Description:
Expand All @@ -1628,7 +1628,7 @@ void DoSrvPrivateEnableVT200MouseMode(const bool fEnable)
void DoSrvPrivateEnableUTF8ExtendedMouseMode(const bool fEnable)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.terminalMouseInput.SetUtf8ExtendedMode(fEnable);
gci.GetActiveInputBuffer()->GetTerminalInput().SetUtf8ExtendedMode(fEnable);
}

// Routine Description:
Expand All @@ -1640,7 +1640,7 @@ void DoSrvPrivateEnableUTF8ExtendedMouseMode(const bool fEnable)
void DoSrvPrivateEnableSGRExtendedMouseMode(const bool fEnable)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.terminalMouseInput.SetSGRExtendedMode(fEnable);
gci.GetActiveInputBuffer()->GetTerminalInput().SetSGRExtendedMode(fEnable);
}

// Routine Description:
Expand All @@ -1652,7 +1652,7 @@ void DoSrvPrivateEnableSGRExtendedMouseMode(const bool fEnable)
void DoSrvPrivateEnableButtonEventMouseMode(const bool fEnable)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.terminalMouseInput.EnableButtonEventTracking(fEnable);
gci.GetActiveInputBuffer()->GetTerminalInput().EnableButtonEventTracking(fEnable);
}

// Routine Description:
Expand All @@ -1664,7 +1664,7 @@ void DoSrvPrivateEnableButtonEventMouseMode(const bool fEnable)
void DoSrvPrivateEnableAnyEventMouseMode(const bool fEnable)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.terminalMouseInput.EnableAnyEventTracking(fEnable);
gci.GetActiveInputBuffer()->GetTerminalInput().EnableAnyEventTracking(fEnable);
}

// Routine Description:
Expand All @@ -1676,7 +1676,7 @@ void DoSrvPrivateEnableAnyEventMouseMode(const bool fEnable)
void DoSrvPrivateEnableAlternateScroll(const bool fEnable)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.terminalMouseInput.EnableAlternateScroll(fEnable);
gci.GetActiveInputBuffer()->GetTerminalInput().EnableAlternateScroll(fEnable);
}

// Routine Description:
Expand Down
4 changes: 2 additions & 2 deletions src/host/screenInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ const SCREEN_INFORMATION& SCREEN_INFORMATION::GetMainBuffer() const
ScreenBufferSizeChange(psiNewAltBuffer->GetBufferSize().Dimensions());

// Tell the VT MouseInput handler that we're in the Alt buffer now
gci.terminalMouseInput.UseAlternateScreenBuffer();
gci.GetActiveInputBuffer()->GetTerminalInput().UseAlternateScreenBuffer();
}
return Status;
}
Expand Down Expand Up @@ -1924,7 +1924,7 @@ void SCREEN_INFORMATION::UseMainScreenBuffer()
// deleting the alt buffer will give the GetSet back to its main

// Tell the VT MouseInput handler that we're in the main buffer now
gci.terminalMouseInput.UseMainScreenBuffer();
gci.GetActiveInputBuffer()->GetTerminalInput().UseMainScreenBuffer();
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/host/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ class CONSOLE_INFORMATION :

ConsoleImeInfo ConsoleIme;

Microsoft::Console::VirtualTerminal::TerminalInput terminalMouseInput;

void LockConsole();
bool TryLockConsole();
void UnlockConsole();
Expand Down
2 changes: 1 addition & 1 deletion src/interactivity/win32/windowio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ bool HandleTerminalMouseEvent(const COORD cMousePosition,
// Virtual terminal input mode
if (IsInVirtualTerminalInputMode())
{
fWasHandled = gci.terminalMouseInput.HandleMouse(cMousePosition, uiButton, sModifierKeystate, sWheelDelta);
fWasHandled = gci.GetActiveInputBuffer()->GetTerminalInput().HandleMouse(cMousePosition, uiButton, sModifierKeystate, sWheelDelta);
}

return fWasHandled;
Expand Down

0 comments on commit 55a6cee

Please sign in to comment.