Skip to content

Commit

Permalink
eh these events are from pane content anyways!
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 19, 2024
1 parent 052dc78 commit a7533fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
14 changes: 7 additions & 7 deletions src/cascadia/TerminalApp/IPaneContent.idl
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ namespace TerminalApp

void Close();

event Windows.Foundation.TypedEventHandler<Object, Object> CloseRequested;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> CloseRequested;

event Windows.Foundation.TypedEventHandler<Object, BellEventArgs> BellRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> TitleChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> TabColorChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> TaskbarProgressChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> ConnectionStateChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> ReadOnlyChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> FocusRequested;
event Windows.Foundation.TypedEventHandler<IPaneContent, BellEventArgs> BellRequested;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> TitleChanged;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> TabColorChanged;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> TaskbarProgressChanged;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> ReadOnlyChanged;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> FocusRequested;
};


Expand Down
14 changes: 7 additions & 7 deletions src/cascadia/TerminalApp/TerminalPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ namespace winrt::TerminalApp::implementation
Windows::Foundation::Size GridUnitSize();

til::typed_event<TerminalApp::TerminalPaneContent, winrt::Windows::Foundation::IInspectable> RestartTerminalRequested;
til::typed_event<> CloseRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::BellEventArgs> BellRequested;
til::typed_event<> TitleChanged;
til::typed_event<> TabColorChanged;
til::typed_event<> TaskbarProgressChanged;
til::typed_event<> ConnectionStateChanged;
til::typed_event<> ReadOnlyChanged;
til::typed_event<> FocusRequested;
til::typed_event<IPaneContent> CloseRequested;
til::typed_event<IPaneContent, winrt::TerminalApp::BellEventArgs> BellRequested;
til::typed_event<IPaneContent> TitleChanged;
til::typed_event<IPaneContent> TabColorChanged;
til::typed_event<IPaneContent> TaskbarProgressChanged;
til::typed_event<IPaneContent> ReadOnlyChanged;
til::typed_event<IPaneContent> FocusRequested;

private:
winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
Expand Down
7 changes: 2 additions & 5 deletions src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,17 +1021,14 @@ namespace winrt::TerminalApp::implementation

events.FocusRequested = content.FocusRequested(
winrt::auto_revoke,
[dispatcher, weakThis](auto sender, auto) -> winrt::fire_and_forget {
[dispatcher, weakThis](TerminalApp::IPaneContent sender, auto) -> winrt::fire_and_forget {
const auto weakThisCopy = weakThis;
co_await wil::resume_foreground(dispatcher);
if (const auto tab{ weakThisCopy.get() })
{
if (tab->_focused())
{
if (const auto content{ sender.try_as<TerminalApp::IPaneContent>() })
{
content.Focus(FocusState::Pointer);
}
sender.Focus(FocusState::Pointer);
}
}
});
Expand Down

0 comments on commit a7533fa

Please sign in to comment.