Skip to content

Commit

Permalink
bind the name, id down to the actual page
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 1, 2021
1 parent 001f545 commit 9270e0f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
22 changes: 22 additions & 0 deletions src/cascadia/TerminalApp/AppLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,28 @@ namespace winrt::TerminalApp::implementation
}
}

winrt::hstring AppLogic::WindowName()
{
return _root ? _root->WindowName() : L"";
}
void AppLogic::WindowName(const winrt::hstring& name)
{
if (_root)
{
_root->WindowName(name);
}
}
uint64_t AppLogic::WindowId()
{
return _root ? _root->WindowId() : 0;
}
void AppLogic::WindowId(const uint64_t& id)
{
if (_root)
{
_root->WindowId(id);
}
}
// -------------------------------- WinRT Events ---------------------------------
// Winrt events need a method for adding a callback to the event and removing the callback.
// These macros will define them both for you.
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/TerminalApp/AppLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ namespace winrt::TerminalApp::implementation
bool FocusMode() const;
bool Fullscreen() const;
bool AlwaysOnTop() const;

void IdentifyWindow();
winrt::hstring WindowName();
void WindowName(const winrt::hstring& name);
uint64_t WindowId();
void WindowId(const uint64_t& id);

Windows::Foundation::Size GetLaunchDimensions(uint32_t dpi);
bool CenterOnLaunch();
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/AppLogic.idl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ namespace TerminalApp
Boolean FocusMode { get; };
Boolean Fullscreen { get; };
Boolean AlwaysOnTop { get; };

void IdentifyWindow();
String WindowName;
UInt64 WindowId;

Windows.Foundation.Size GetLaunchDimensions(UInt32 dpi);
Boolean CenterOnLaunch { get; };
Expand Down
3 changes: 0 additions & 3 deletions src/cascadia/TerminalApp/TerminalPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ namespace winrt::TerminalApp::implementation

winrt::fire_and_forget IdentifyWindow();

// winrt::hstring WindowName();
// uint64_t WindowId();

winrt::fire_and_forget ProcessStartupActions(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::ActionAndArgs> actions,
const bool initial,
const winrt::hstring cwd = L"");
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/WindowsTerminal/AppHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ void AppHost::_HandleCommandlineArgs()
peasant.ExecuteCommandlineRequested({ this, &AppHost::_DispatchCommandline });

peasant.DisplayWindowIdRequested({ this, &AppHost::_DisplayWindowId });

_logic.WindowName(peasant.WindowName());
_logic.WindowId(peasant.GetID());
}
}

Expand Down

0 comments on commit 9270e0f

Please sign in to comment.