Skip to content

Commit

Permalink
some of the easier nits
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 19, 2024
1 parent 524d658 commit 6789ec0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 35 deletions.
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/Pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#include "pch.h"
#include "Pane.h"

#include "BellEventArgs.g.cpp"

#include "AppLogic.h"

#include "Utils.h"
Expand Down
13 changes: 13 additions & 0 deletions src/cascadia/TerminalApp/Pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "TaskbarState.h"
#include "TerminalPaneContent.h"
#include "BellEventArgs.g.h"

// fwdecl unittest classes
namespace TerminalAppLocalTests
Expand Down Expand Up @@ -59,6 +60,18 @@ struct PaneResources
winrt::Windows::UI::Xaml::Media::SolidColorBrush broadcastBorderBrush{ nullptr };
};

namespace winrt::TerminalApp::implementation
{
struct BellEventArgs : public BellEventArgsT<BellEventArgs>
{
public:
BellEventArgs(bool flashTaskbar) :
FlashTaskbar(flashTaskbar) {}

til::property<bool> FlashTaskbar;
};
};

class Pane : public std::enable_shared_from_this<Pane>
{
public:
Expand Down
6 changes: 0 additions & 6 deletions src/cascadia/TerminalApp/PaneArgs.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions src/cascadia/TerminalApp/PaneArgs.h

This file was deleted.

14 changes: 7 additions & 7 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3125,8 +3125,8 @@ namespace winrt::TerminalApp::implementation
// serialize the actual profile's GUID along with the content guid.
const auto& profile = _settings.GetProfileForArgs(newTerminalArgs);
const auto control = _AttachControlToContent(newTerminalArgs.ContentId());
auto terminalPane{ winrt::make<TerminalPaneContent>(profile, control) };
return std::make_shared<Pane>(terminalPane);
auto paneContent{ winrt::make<TerminalPaneContent>(profile, control) };
return std::make_shared<Pane>(paneContent);
}

TerminalSettingsCreateResult controlSettings{ nullptr };
Expand Down Expand Up @@ -3182,15 +3182,15 @@ namespace winrt::TerminalApp::implementation

const auto control = _CreateNewControlAndContent(controlSettings, connection);

auto terminalPane{ winrt::make<TerminalPaneContent>(profile, control) };
auto resultPane = std::make_shared<Pane>(terminalPane);
auto paneContent{ winrt::make<TerminalPaneContent>(profile, control) };
auto resultPane = std::make_shared<Pane>(paneContent);

if (debugConnection) // this will only be set if global debugging is on and tap is active
{
auto newControl = _CreateNewControlAndContent(controlSettings, debugConnection);
// Split (auto) with the debug tap.
auto debugTerminalPane{ winrt::make<TerminalPaneContent>(profile, newControl) };
auto debugPane = std::make_shared<Pane>(debugTerminalPane);
auto debugContent{ winrt::make<TerminalPaneContent>(profile, newControl) };
auto debugPane = std::make_shared<Pane>(debugContent);

// Since we're doing this split directly on the pane (instead of going through TerminalTab,
// we need to handle the panes 'active' states
Expand All @@ -3204,7 +3204,7 @@ namespace winrt::TerminalApp::implementation
original->SetActive();
}

_RegisterPaneEvents(terminalPane);
_RegisterPaneEvents(paneContent);

return resultPane;
}
Expand Down
4 changes: 1 addition & 3 deletions src/cascadia/TerminalApp/TerminalPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#pragma once
#include "TerminalPaneContent.g.h"
#include "../../cascadia/inc/cppwinrt_utils.h"
#include <til/winrt.h>

namespace winrt::TerminalApp::implementation
{
Expand All @@ -29,7 +27,7 @@ namespace winrt::TerminalApp::implementation
winrt::Microsoft::Terminal::Settings::Model::Profile GetProfile() const
{
return _profile;
};
}

winrt::hstring Title() { return _control.Title(); }
uint64_t TaskbarState() { return _control.TaskbarState(); }
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ namespace winrt::TerminalApp::implementation
events.CloseRequested = content.CloseRequested(
winrt::auto_revoke,
[dispatcher, weakThis](auto sender, auto&&) -> winrt::fire_and_forget {
// Don't forget! this ^^^^^^^^ sender can't be a reference, this is a async callback.
// Don't forget! this ^^^^^^^^ sender can't be a reference, this is a async callback.

// The lambda lives in the `std::function`-style container owned by `control`. That is, when the
// `control` gets destroyed the lambda struct also gets destroyed. In other words, we need to
Expand Down

0 comments on commit 6789ec0

Please sign in to comment.