Skip to content

Commit c15f4d4

Browse files
committed
PRE-MERGE #18434 Fix 'closeWindow' ignoring confirmation
2 parents 25392ea + cbef831 commit c15f4d4

File tree

7 files changed

+1
-9
lines changed

7 files changed

+1
-9
lines changed

src/cascadia/TerminalApp/AppActionHandlers.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ namespace winrt::TerminalApp::implementation
118118
void TerminalPage::_HandleCloseWindow(const IInspectable& /*sender*/,
119119
const ActionEventArgs& args)
120120
{
121-
CloseRequested.raise(nullptr, nullptr);
121+
CloseWindow();
122122
args.Handled(true);
123123
}
124124

src/cascadia/TerminalApp/TerminalPage.h

-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ namespace winrt::TerminalApp::implementation
182182
til::typed_event<IInspectable, IInspectable> SummonWindowRequested;
183183
til::typed_event<IInspectable, winrt::Microsoft::Terminal::Control::WindowSizeChangedEventArgs> WindowSizeChanged;
184184

185-
til::typed_event<IInspectable, IInspectable> CloseRequested;
186185
til::typed_event<IInspectable, IInspectable> OpenSystemMenu;
187186
til::typed_event<IInspectable, IInspectable> QuitRequested;
188187
til::typed_event<IInspectable, winrt::Microsoft::Terminal::Control::ShowWindowArgs> ShowWindowChanged;

src/cascadia/TerminalApp/TerminalPage.idl

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ namespace TerminalApp
9595
event Windows.Foundation.TypedEventHandler<Object, Object> SummonWindowRequested;
9696
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Control.WindowSizeChangedEventArgs> WindowSizeChanged;
9797

98-
event Windows.Foundation.TypedEventHandler<Object, Object> CloseRequested;
9998
event Windows.Foundation.TypedEventHandler<Object, Object> OpenSystemMenu;
10099
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Control.ShowWindowArgs> ShowWindowChanged;
101100

src/cascadia/TerminalApp/TerminalWindow.h

-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ namespace winrt::TerminalApp::implementation
219219
FORWARDED_TYPED_EVENT(SetTaskbarProgress, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, SetTaskbarProgress);
220220
FORWARDED_TYPED_EVENT(IdentifyWindowsRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IdentifyWindowsRequested);
221221
FORWARDED_TYPED_EVENT(SummonWindowRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, SummonWindowRequested);
222-
FORWARDED_TYPED_EVENT(CloseRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, CloseRequested);
223222
FORWARDED_TYPED_EVENT(OpenSystemMenu, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, OpenSystemMenu);
224223
FORWARDED_TYPED_EVENT(QuitRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, QuitRequested);
225224
FORWARDED_TYPED_EVENT(ShowWindowChanged, Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Control::ShowWindowArgs, _root, ShowWindowChanged);

src/cascadia/TerminalApp/TerminalWindow.idl

-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ namespace TerminalApp
122122
event Windows.Foundation.TypedEventHandler<Object, Object> IdentifyWindowsRequested;
123123
event Windows.Foundation.TypedEventHandler<Object, Object> IsQuakeWindowChanged;
124124
event Windows.Foundation.TypedEventHandler<Object, Object> SummonWindowRequested;
125-
event Windows.Foundation.TypedEventHandler<Object, Object> CloseRequested;
126125
event Windows.Foundation.TypedEventHandler<Object, Object> OpenSystemMenu;
127126
event Windows.Foundation.TypedEventHandler<Object, Object> QuitRequested;
128127
event Windows.Foundation.TypedEventHandler<Object, TerminalApp.SystemMenuChangeArgs> SystemMenuChangeRequested;

src/cascadia/WindowsTerminal/AppHost.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ void AppHost::Initialize()
213213
_windowCallbacks.WindowCloseButtonClicked = _window->WindowCloseButtonClicked([this]() {
214214
_windowLogic.CloseWindow();
215215
});
216-
// If the user requests a close in another way handle the same as if the 'X'
217-
// was clicked.
218-
_revokers.CloseRequested = _windowLogic.CloseRequested(winrt::auto_revoke, { this, &AppHost::_CloseRequested });
219216

220217
// Add an event handler to plumb clicks in the titlebar area down to the
221218
// application layer.

src/cascadia/WindowsTerminal/AppHost.h

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class AppHost : public std::enable_shared_from_this<AppHost>
138138
struct Revokers
139139
{
140140
winrt::TerminalApp::TerminalWindow::Initialized_revoker Initialized;
141-
winrt::TerminalApp::TerminalWindow::CloseRequested_revoker CloseRequested;
142141
winrt::TerminalApp::TerminalWindow::RequestedThemeChanged_revoker RequestedThemeChanged;
143142
winrt::TerminalApp::TerminalWindow::FullscreenChanged_revoker FullscreenChanged;
144143
winrt::TerminalApp::TerminalWindow::FocusModeChanged_revoker FocusModeChanged;

0 commit comments

Comments
 (0)