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

7124: Add focus and maximizedFocus launch modes #7873

Merged
10 commits merged into from
Oct 14, 2020
4 changes: 4 additions & 0 deletions src/cascadia/TerminalApp/AppLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ namespace winrt::TerminalApp::implementation
{
_root->ToggleFullscreen();
}
else if (launchMode == LaunchMode::FocusedMode || launchMode == LaunchMode::MaximizedFocusedMode)
{
_root->ToggleFocusMode();
}
});
_root->Create();

Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace Microsoft.Terminal.Settings.Model
DefaultMode,
MaximizedMode,
FullscreenMode,
FocusedMode,
MaximizedFocusedMode,
};

[default_interface] runtimeclass GlobalAppSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ JSON_ENUM_MAPPER(::winrt::Windows::UI::Xaml::ElementTheme)

JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::LaunchMode)
{
JSON_MAPPINGS(3) = {
JSON_MAPPINGS(5) = {
pair_type{ "default", ValueType::DefaultMode },
pair_type{ "maximized", ValueType::MaximizedMode },
pair_type{ "fullscreen", ValueType::FullscreenMode },
pair_type{ "focused", ValueType::FocusedMode },
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
pair_type{ "maximizedFocused", ValueType::MaximizedFocusedMode },
};
};

Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/WindowsTerminal/IslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void IslandWindow::_HandleCreateWindow(const WPARAM, const LPARAM lParam) noexce
}

int nCmdShow = SW_SHOW;
if (launchMode == LaunchMode::MaximizedMode)
if (launchMode == LaunchMode::MaximizedMode || launchMode == LaunchMode::MaximizedFocusedMode)
{
nCmdShow = SW_MAXIMIZE;
}
Expand Down