Skip to content

Commit

Permalink
feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 4, 2021
1 parent 27d12a2 commit c202257
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/cascadia/Remoting/WindowManager.cpp
Expand Up @@ -71,7 +71,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// Otherwise, the King will tell us if we should make a new window
_shouldCreateWindow = _isKing;
std::optional<uint64_t> givenID;
winrt::hstring givenName = L""; // TODO:MG If we're the king, we might STILL WANT TO GET THE NAME. How do we get the name?
winrt::hstring givenName = L"";
if (!_isKing)
{
// The monarch may respond back "you should be a new
Expand Down Expand Up @@ -123,7 +123,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
auto findWindowArgs{ winrt::make_self<Remoting::implementation::FindTargetWindowArgs>(args) };
_raiseFindTargetWindowRequested(nullptr, *findWindowArgs);

auto responseId = findWindowArgs->ResultTargetWindow();
const auto responseId = findWindowArgs->ResultTargetWindow();
if (responseId > 0)
{
givenID = ::base::saturated_cast<uint64_t>(responseId);
Expand Down
6 changes: 0 additions & 6 deletions src/cascadia/TerminalApp/AppCommandlineArgs.cpp
Expand Up @@ -859,11 +859,5 @@ void AppCommandlineArgs::FullResetState()

std::string_view AppCommandlineArgs::GetTargetWindow() const noexcept
{
// // If the user provides _any_ negative number, then treat it as -1, for "use a new window".
// if (_windowTarget.has_value() && *_windowTarget < 0)
// {
// return { -1 };
// }

return _windowTarget;
}
12 changes: 6 additions & 6 deletions src/cascadia/TerminalApp/AppLogic.cpp
Expand Up @@ -1240,7 +1240,7 @@ namespace winrt::TerminalApp::implementation
{
if (!appArgs.GetExitMessage().empty())
{
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseNew, L"");
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseNew);
}

const std::string parsedTarget{ appArgs.GetTargetWindow() };
Expand All @@ -1263,7 +1263,7 @@ namespace winrt::TerminalApp::implementation
windowId = WindowingBehaviorUseAnyExisting;
break;
}
return winrt::make<FindTargetWindowResult>(windowId, L"");
return winrt::make<FindTargetWindowResult>(windowId);
}

// Here, the user _has_ provided a window-id on the commandline.
Expand All @@ -1282,7 +1282,7 @@ namespace winrt::TerminalApp::implementation

// Hooray! This is a valid integer. The set of possible values
// here is {-1, 0, ℤ+}. Let's return that window ID.
return winrt::make<TerminalApp::implementation::FindTargetWindowResult>(windowId, L"");
return winrt::make<FindTargetWindowResult>(windowId);
}
catch (...)
{
Expand All @@ -1292,11 +1292,11 @@ namespace winrt::TerminalApp::implementation
// First, check the reserved keywords:
if (parsedTarget == "new")
{
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseNew, L"");
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseNew);
}
else if (parsedTarget == "last")
{
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseExisting, L"");
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseExisting);
}
else
{
Expand All @@ -1319,7 +1319,7 @@ namespace winrt::TerminalApp::implementation
// create a new window. Then, in that new window, we'll try to set the
// StartupActions, which will again fail, returning the correct error
// message.
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseNew, L"");
return winrt::make<FindTargetWindowResult>(WindowingBehaviorUseNew);
}

// Method Description:
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/AppLogic.h
Expand Up @@ -27,6 +27,9 @@ namespace winrt::TerminalApp::implementation
public:
FindTargetWindowResult(const int32_t id, const winrt::hstring& name) :
_WindowId{ id }, _WindowName{ name } {};

FindTargetWindowResult(const int32_t id) :
FindTargetWindowResult(id, L""){};
};

struct AppLogic : AppLogicT<AppLogic, IInitializeWithWindow>
Expand Down

0 comments on commit c202257

Please sign in to comment.