Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add globalSummon action #9854

Merged
merged 85 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3bef7bb
Get all the projects created and hooked up to the sln
zadjii-msft Dec 16, 2020
1f52d35
Yank all the M/P files, this builds?!
zadjii-msft Dec 16, 2020
5a9cdc8
Shockingly, this works, it works elevated, and it works unpackaged
zadjii-msft Dec 16, 2020
36539cf
This won't work, but I'm committing this becaus I finally got it to c…
zadjii-msft Dec 16, 2020
27ace16
whoop, we pass the commandline from the peasant, to the monarch, and …
zadjii-msft Dec 16, 2020
9a41647
HOLY SHIT I GOT THE COMANDLINE TO EXECUTE IN THE CURRENT WINDOW!!!!!!…
zadjii-msft Dec 17, 2020
5cabcfb
add a note to future me
zadjii-msft Dec 17, 2020
03bfc6e
This works as a unittest, but not a local test. That's batty
zadjii-msft Dec 17, 2020
590b9ff
this macro makes me feel dirty
zadjii-msft Dec 17, 2020
0579b24
LocalTests_Remoting -> UnitTests_Remoting
zadjii-msft Dec 17, 2020
a3faed6
finish renaming this test
zadjii-msft Dec 17, 2020
9c6eac4
Clean up a lot for review
zadjii-msft Dec 17, 2020
0103331
cleanup Peasant for review
zadjii-msft Dec 17, 2020
b4fe1bf
Final cleanup for review
zadjii-msft Dec 17, 2020
d08e65c
_final_ final cleanup for review
zadjii-msft Dec 17, 2020
e101efd
pr nits
zadjii-msft Dec 18, 2020
e1402d8
This seems to work to create a thread listening for the monarch, and …
zadjii-msft Dec 18, 2020
f978a9c
it's hard to believe he's gone / were it so easy
zadjii-msft Dec 18, 2020
5939636
Oh yea actually remove the thing
zadjii-msft Dec 18, 2020
c088895
last commit before the holidays
zadjii-msft Dec 18, 2020
fa2df47
Merge remote-tracking branch 'origin/main' into dev/migrie/f/remoting…
zadjii-msft Jan 5, 2021
0f5c24f
Enable audit mode
zadjii-msft Jan 5, 2021
921d915
nits
zadjii-msft Jan 5, 2021
00184e7
Merge branch 'dev/migrie/f/remoting.dll' into dev/migrie/f/the-first-…
zadjii-msft Jan 5, 2021
658db6b
Ask the TerminalApp to parse the commandline, and tell us what the wi…
zadjii-msft Jan 6, 2021
977db46
Holy bajesus, this works like a charm
zadjii-msft Jan 6, 2021
bcbef34
Add a note about commiting suicide
zadjii-msft Jan 6, 2021
813dbc6
notes, comments, cleanup
zadjii-msft Jan 6, 2021
0f0df5e
activate windows
zadjii-msft Jan 6, 2021
9fc2f0e
add some tracelogging
zadjii-msft Jan 6, 2021
6537686
The peasant will now correctly inform the monarch when it re-connects
zadjii-msft Jan 7, 2021
a75da0a
mostly just notes
zadjii-msft Jan 7, 2021
c02f25a
peasants now switch to the cwd that was requested
zadjii-msft Jan 7, 2021
3e39ab9
more comments
zadjii-msft Jan 7, 2021
52b2cb6
Allow the user to provide ids on the commandline
zadjii-msft Jan 7, 2021
bc492f1
Code cleanup
zadjii-msft Jan 7, 2021
88ffc6f
Merge remote-tracking branch 'origin/main' into dev/migrie/f/remoting…
zadjii-msft Jan 7, 2021
be74b2e
putting var in headers is bad, mkay?
zadjii-msft Jan 7, 2021
2a7bc94
branding
zadjii-msft Jan 7, 2021
81c09d9
Merge branch 'dev/migrie/f/remoting.dll' into dev/migrie/f/the-first-…
zadjii-msft Jan 8, 2021
c34e4ce
Merge remote-tracking branch 'origin/main' into dev/migrie/f/the-firs…
zadjii-msft Jan 8, 2021
5b8ace2
A bunch of tests for Monarch::ProposeCommandline
zadjii-msft Jan 8, 2021
689c385
sure yea that's a doc comment
zadjii-msft Jan 8, 2021
59deca1
Merge branch 'main' into dev/migrie/f/the-first-galactic-empire
zadjii-msft Jan 26, 2021
f02969b
More tests, more redundancy
zadjii-msft Jan 26, 2021
b2db317
man I can't spel
zadjii-msft Jan 26, 2021
d2a3438
Add try/catch's throughout Monarch.cpp
zadjii-msft Jan 27, 2021
a65f341
trycatch the window manager. A lot more going on there.
zadjii-msft Jan 27, 2021
1c2f8e5
This will always summon the monarch window
zadjii-msft Jan 28, 2021
71f6b58
RegisterHotKey will be more robust
zadjii-msft Jan 28, 2021
18d1a20
Add support for the `win` key in keybindings
zadjii-msft Jan 28, 2021
a41bee6
!!! THIS NEEDS TO BE MOVED TO THE PARENT BRANCH !!!
zadjii-msft Jan 28, 2021
6e7ea61
!!! THIS NEEDS TO BE MOVED TO THE PARENT BRANCH !!!
zadjii-msft Jan 28, 2021
18099d2
Summon the most recent window
zadjii-msft Jan 28, 2021
3e5d927
Cleanup, now that this isn't needed
zadjii-msft Jan 28, 2021
91b52d4
!!! THIS NEEDS TO BE MOVED TO THE PARENT BRANCH !!!
zadjii-msft Jan 28, 2021
848682a
Oh hey SetForegroundWindow might be the thing
zadjii-msft Jan 28, 2021
1dcb4cb
man this is crisp
zadjii-msft Jan 28, 2021
fee6473
Still trying to figure this out exactly. For linking: #653
zadjii-msft Jan 28, 2021
342d3f2
This works if the window _isn't_ minimized
zadjii-msft Jan 29, 2021
5052d31
deal with minimized windows too
zadjii-msft Jan 29, 2021
eff18d1
more cleanup
zadjii-msft Jan 29, 2021
5c039ea
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 12, 2021
10779ca
We caan now summon based on window name or just use the MRU one. Note…
zadjii-msft Apr 12, 2021
25b31ff
Allow the user to set multiple globalSummon keys, and quakeMode for s…
zadjii-msft Apr 12, 2021
7c2a514
if there is no window with the name, then make a new window with the …
zadjii-msft Apr 12, 2021
ac8fef0
THATS RIGHT, IT HOT-RELOADS
zadjii-msft Apr 12, 2021
1fdb6b1
Tests and doc comments
zadjii-msft Apr 14, 2021
784ec73
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 14, 2021
b20222f
More comments
zadjii-msft Apr 14, 2021
9d76c62
Some dead code cleanup
zadjii-msft Apr 14, 2021
2a2f5cb
pre emptive spellbot
zadjii-msft Apr 14, 2021
71577fc
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 16, 2021
f892752
Add some tracelogging to find a heisenbug that might not have ever be…
zadjii-msft Apr 16, 2021
4166afa
Okay that was bad pre-emptive spelling
zadjii-msft Apr 16, 2021
717db81
Again, nobody's got disk space to build x86. This is a guess
zadjii-msft Apr 19, 2021
1b2e7a7
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 19, 2021
2eec961
All of carlos's feedback
zadjii-msft Apr 21, 2021
15a8a9c
!! THIS NEEDS TO GO TO THE PARENT BRANCH !!
zadjii-msft Apr 19, 2021
8370789
replace todo with comment
zadjii-msft Apr 21, 2021
4eb1d3a
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 23, 2021
643b860
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 27, 2021
aec2561
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 28, 2021
5940f05
Merge remote-tracking branch 'origin/main' into dev/migrie/f/653-QUAK…
zadjii-msft Apr 28, 2021
06cb41b
Address Dustin's PR comments
zadjii-msft Apr 28, 2021
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
1 change: 1 addition & 0 deletions .github/actions/spelling/dictionary/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ NOASYNC
NOCHANGEDIR
NOPROGRESS
NOREDIRECTIONBITMAP
NOREPEAT
ntprivapi
oaidl
ocidl
Expand Down
6 changes: 6 additions & 0 deletions src/cascadia/Remoting/Microsoft.Terminal.RemotingLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<ClInclude Include="ProposeCommandlineResult.h">
<DependentUpon>Monarch.idl</DependentUpon>
</ClInclude>
<ClInclude Include="SummonWindowSelectionArgs.h">
<DependentUpon>Monarch.idl</DependentUpon>
</ClInclude>
<ClInclude Include="RenameRequestArgs.h">
<DependentUpon>Peasant.idl</DependentUpon>
</ClInclude>
Expand Down Expand Up @@ -54,6 +57,9 @@
<ClCompile Include="ProposeCommandlineResult.cpp">
<DependentUpon>Monarch.idl</DependentUpon>
</ClCompile>
<ClCompile Include="SummonWindowSelectionArgs.cpp">
<DependentUpon>Monarch.idl</DependentUpon>
</ClCompile>
<ClCompile Include="RenameRequestArgs.cpp">
<DependentUpon>Peasant.idl</DependentUpon>
</ClCompile>
Expand Down
49 changes: 48 additions & 1 deletion src/cascadia/Remoting/Monarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
continue;
}

if (peasant.WindowName() == L"_quake")
if (peasant.WindowName() == QuakeWindowName)
{
// The _quake window should never be treated as the MRU window.
// Skip it if we see it. Users can still target it with `wt -w
Expand Down Expand Up @@ -686,4 +686,51 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
}
}

// Method Description:
// - Attempt to summon a window. `args` contains information about which
// window we should try to summon:
// * if a WindowName is provided, we'll try to find a window with exactly
// that name, and fail if there isn't one.
// - Calls Peasant::Summon on the matching peasant (which might be an RPC call)
// - This should only ever be called by the WindowManager in the monarch
// process itself. The monarch is the one registering for global hotkeys,
// so it's the one calling this method.
// Arguments:
// - args: contains information about the window that should be summoned.
// Return Value:
// - <none>
// - Sets args.FoundMatch when a window matching args is found successfully.
void Monarch::SummonWindow(const Remoting::SummonWindowSelectionArgs& args)
{
const auto searchedForName{ args.WindowName() };
try
{
args.FoundMatch(false);
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
uint64_t windowId = 0;
// If no name was provided, then just summon the MRU window.
if (searchedForName.empty())
{
windowId = _getMostRecentPeasantID(true);
}
else
{
// Try to find a peasant that currently has this name
windowId = _lookupPeasantIdForName(searchedForName);
}
if (auto targetPeasant{ _getPeasant(windowId) })
{
targetPeasant.Summon();
args.FoundMatch(true);
}
}
catch (...)
{
LOG_CAUGHT_EXCEPTION();
TraceLoggingWrite(g_hRemotingProvider,
"Monarch_SummonWindow_Failed",
TraceLoggingWideString(searchedForName.c_str(), "searchedForName", "The name of the window we tried to summon"),
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
}
}
}
1 change: 1 addition & 0 deletions src/cascadia/Remoting/Monarch.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation

winrt::Microsoft::Terminal::Remoting::ProposeCommandlineResult ProposeCommandline(const winrt::Microsoft::Terminal::Remoting::CommandlineArgs& args);
void HandleActivatePeasant(const winrt::Microsoft::Terminal::Remoting::WindowActivatedArgs& args);
void SummonWindow(const Remoting::SummonWindowSelectionArgs& args);

TYPED_EVENT(FindTargetWindowRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs);

Expand Down
12 changes: 12 additions & 0 deletions src/cascadia/Remoting/Monarch.idl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,25 @@ namespace Microsoft.Terminal.Remoting
Boolean ShouldCreateWindow { get; }; // If you name this `CreateWindow`, the compiler will explode
}

[default_interface] runtimeclass SummonWindowSelectionArgs {
SummonWindowSelectionArgs();
SummonWindowSelectionArgs(String windowName);
String WindowName;
// TODO GH#8888 Other options:
// * CurrentDesktop
// * CurrentMonitor

Boolean FoundMatch;
}

[default_interface] runtimeclass Monarch {
Monarch();

UInt64 GetPID();
UInt64 AddPeasant(IPeasant peasant);
ProposeCommandlineResult ProposeCommandline(CommandlineArgs args);
void HandleActivatePeasant(WindowActivatedArgs args);
void SummonWindow(SummonWindowSelectionArgs args);

event Windows.Foundation.TypedEventHandler<Object, FindTargetWindowArgs> FindTargetWindowRequested;
};
Expand Down
19 changes: 19 additions & 0 deletions src/cascadia/Remoting/Peasant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
return _lastActivatedArgs;
}

// Method Description:
// - Summon this peasant to become the active window. Currently, it just
// causes the peasant to become the active window wherever the window
// already was.
// - Will raise a SummonRequested event to ask the hosting window to handle for us.
// Arguments:
// - <none>
// Return Value:
// - <none>
void Peasant::Summon()
{
_SummonRequestedHandlers(*this, nullptr);

TraceLoggingWrite(g_hRemotingProvider,
"Peasant_Summon",
TraceLoggingUInt64(GetID(), "peasantID", "Our ID"),
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE));
}

// Method Description:
// - Tell this window to display it's window ID. We'll raise a
// DisplayWindowIdRequested event, which will get handled in the AppHost,
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/Remoting/Peasant.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation

bool ExecuteCommandline(const winrt::Microsoft::Terminal::Remoting::CommandlineArgs& args);
void ActivateWindow(const winrt::Microsoft::Terminal::Remoting::WindowActivatedArgs& args);

void Summon();
void RequestIdentifyWindows();
void DisplayWindowId();
void RequestRename(const winrt::Microsoft::Terminal::Remoting::RenameRequestArgs& args);
Expand All @@ -37,6 +39,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
TYPED_EVENT(IdentifyWindowsRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(DisplayWindowIdRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
TYPED_EVENT(RenameRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::RenameRequestArgs);
TYPED_EVENT(SummonRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);

private:
Peasant(const uint64_t testPID);
Expand Down
7 changes: 5 additions & 2 deletions src/cascadia/Remoting/Peasant.idl
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ namespace Microsoft.Terminal.Remoting
Boolean ExecuteCommandline(CommandlineArgs args);
void ActivateWindow(WindowActivatedArgs args);
WindowActivatedArgs GetLastActivatedArgs();
String WindowName { get; };
void RequestIdentifyWindows(); // Tells us to raise a IdentifyWindowsRequested

void DisplayWindowId(); // Tells us to display its own ID (which causes a DisplayWindowIdRequested to be raised)

String WindowName { get; };
void RequestIdentifyWindows(); // Tells us to raise a IdentifyWindowsRequested
void RequestRename(RenameRequestArgs args); // Tells us to raise a RenameRequested
void Summon();

event Windows.Foundation.TypedEventHandler<Object, WindowActivatedArgs> WindowActivated;
event Windows.Foundation.TypedEventHandler<Object, CommandlineArgs> ExecuteCommandlineRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> IdentifyWindowsRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> DisplayWindowIdRequested;
event Windows.Foundation.TypedEventHandler<Object, RenameRequestArgs> RenameRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> SummonRequested;
};

[default_interface] runtimeclass Peasant : IPeasant
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/Remoting/SummonWindowSelectionArgs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "SummonWindowSelectionArgs.h"
#include "SummonWindowSelectionArgs.g.cpp"
40 changes: 40 additions & 0 deletions src/cascadia/Remoting/SummonWindowSelectionArgs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

Class Name:
- SummonWindowSelectionArgs.h

Abstract:
- This is a helper class for determining which window a should be summoned when
a global hotkey is pressed. Parameters from a GlobalSummon action will be
filled in here. The Monarch will use these to find the window that matches
these args, and Summon() that Peasant.
- When the monarch finds a match, it will set FoundMatch to true. If it doesn't,
then the Monarch window might need to create a new window matching these args
instead.
--*/

#pragma once

#include "SummonWindowSelectionArgs.g.h"
#include "../cascadia/inc/cppwinrt_utils.h"

namespace winrt::Microsoft::Terminal::Remoting::implementation
{
struct SummonWindowSelectionArgs : public SummonWindowSelectionArgsT<SummonWindowSelectionArgs>
{
public:
SummonWindowSelectionArgs() = default;
SummonWindowSelectionArgs(winrt::hstring name) :
_WindowName{ name } {};

WINRT_PROPERTY(winrt::hstring, WindowName);
WINRT_PROPERTY(bool, FoundMatch, false);
};
}

namespace winrt::Microsoft::Terminal::Remoting::factory_implementation
{
BASIC_FACTORY(SummonWindowSelectionArgs);
}
16 changes: 16 additions & 0 deletions src/cascadia/Remoting/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// window, and when the current monarch dies.

_monarch.FindTargetWindowRequested({ this, &WindowManager::_raiseFindTargetWindowRequested });

_BecameMonarchHandlers(*this, nullptr);
}

bool WindowManager::_areWeTheKing()
Expand Down Expand Up @@ -478,4 +480,18 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
{
_FindTargetWindowRequestedHandlers(sender, args);
}

bool WindowManager::IsMonarch()
{
return _isKing;
}

void WindowManager::SummonWindow(const Remoting::SummonWindowSelectionArgs& args)
{
// We should only ever get called when we are the monarch, because only
// the monarch ever registers for the global hotkey. So the monarch is
// the only window that will be calling this.
_monarch.SummonWindow(args);
}

}
3 changes: 3 additions & 0 deletions src/cascadia/Remoting/WindowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
bool ShouldCreateWindow();

winrt::Microsoft::Terminal::Remoting::Peasant CurrentWindow();
bool IsMonarch();
void SummonWindow(const Remoting::SummonWindowSelectionArgs& args);

TYPED_EVENT(FindTargetWindowRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Remoting::FindTargetWindowArgs);
TYPED_EVENT(BecameMonarch, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);

private:
bool _shouldCreateWindow{ false };
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/Remoting/WindowManager.idl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ namespace Microsoft.Terminal.Remoting
void ProposeCommandline(CommandlineArgs args);
Boolean ShouldCreateWindow { get; };
IPeasant CurrentWindow();
Boolean IsMonarch { get; };
void SummonWindow(SummonWindowSelectionArgs args);
event Windows.Foundation.TypedEventHandler<Object, FindTargetWindowArgs> FindTargetWindowRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> BecameMonarch;
};
}
19 changes: 19 additions & 0 deletions src/cascadia/TerminalApp/AppActionHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,4 +771,23 @@ namespace winrt::TerminalApp::implementation

args.Handled(true);
}

void TerminalPage::_HandleGlobalSummon(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
// Manually return false. These shouldn't ever get here, except for when
// we fail to register for the global hotkey. In that case, returning
// false here will let the underlying terminal still process the key, as
// if it wasn't bound at all.
args.Handled(false);
}
void TerminalPage::_HandleQuakeMode(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
// Manually return false. These shouldn't ever get here, except for when
// we fail to register for the global hotkey. In that case, returning
// false here will let the underlying terminal still process the key, as
// if it wasn't bound at all.
args.Handled(false);
}
}
9 changes: 8 additions & 1 deletion src/cascadia/TerminalApp/AppLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ namespace winrt::TerminalApp::implementation
CATCH_LOG();

// Method Description:
// - Reloads the settings from the profile.json.
// - Reloads the settings from the settings.json file.
void AppLogic::_ReloadSettings()
{
// Attempt to load our settings.
Expand Down Expand Up @@ -1027,6 +1027,8 @@ namespace winrt::TerminalApp::implementation
_ApplyStartupTaskStateChange();

Jumplist::UpdateJumplist(_settings);

_SettingsChangedHandlers(*this, nullptr);
}

// Method Description:
Expand Down Expand Up @@ -1409,6 +1411,11 @@ namespace winrt::TerminalApp::implementation
return _root ? _root->AlwaysOnTop() : false;
}

Windows::Foundation::Collections::IMap<Microsoft::Terminal::Control::KeyChord, Microsoft::Terminal::Settings::Model::ActionAndArgs> AppLogic::GlobalHotkeys()
{
return _settings.GlobalSettings().KeyMap().GlobalHotkeys();
}

void AppLogic::IdentifyWindow()
{
if (_root)
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/AppLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ namespace winrt::TerminalApp::implementation

winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> ShowDialog(winrt::Windows::UI::Xaml::Controls::ContentDialog dialog);

Windows::Foundation::Collections::IMap<Microsoft::Terminal::Control::KeyChord, Microsoft::Terminal::Settings::Model::ActionAndArgs> GlobalHotkeys();

// -------------------------------- WinRT Events ---------------------------------
TYPED_EVENT(RequestedThemeChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::UI::Xaml::ElementTheme);
TYPED_EVENT(SettingsChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);

private:
bool _isUwp{ false };
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 @@ -71,6 +71,8 @@ namespace TerminalApp

FindTargetWindowResult FindTargetWindow(String[] args);

Windows.Foundation.Collections.IMap<Microsoft.Terminal.Control.KeyChord, Microsoft.Terminal.Settings.Model.ActionAndArgs> GlobalHotkeys();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically a View


// See IDialogPresenter and TerminalPage's DialogPresenter for more
// information.
Windows.Foundation.IAsyncOperation<Windows.UI.Xaml.Controls.ContentDialogResult> ShowDialog(Windows.UI.Xaml.Controls.ContentDialog dialog);
Expand All @@ -86,6 +88,7 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<Object, Object> SetTaskbarProgress;
event Windows.Foundation.TypedEventHandler<Object, Object> IdentifyWindowsRequested;
event Windows.Foundation.TypedEventHandler<Object, RenameWindowRequestedArgs> RenameWindowRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> SettingsChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> IsQuakeWindowChanged;
}
}
3 changes: 1 addition & 2 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "DebugTapConnection.h"
#include "SettingsTab.h"
#include "RenameWindowRequestedArgs.g.cpp"
#include "../inc/WindowingBehavior.h"

using namespace winrt;
using namespace winrt::Windows::Foundation::Collections;
Expand All @@ -42,8 +43,6 @@ namespace winrt
using IInspectable = Windows::Foundation::IInspectable;
}

static constexpr std::wstring_view QuakeWindowName{ L"_quake" };

namespace winrt::TerminalApp::implementation
{
TerminalPage::TerminalPage() :
Expand Down
Loading