mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
wip
This commit is contained in:
parent
54aaa4a98a
commit
08daa13dbf
@ -1140,7 +1140,7 @@ void AppHost::_WindowMoved()
|
||||
void AppHost::_CloseRequested(const winrt::Windows::Foundation::IInspectable& /*sender*/,
|
||||
const winrt::Windows::Foundation::IInspectable& /*args*/)
|
||||
{
|
||||
PostMessageW(_windowManager->GetMainWindow(), WindowEmperor::WM_CLOSE_TERMINAL_WINDOW, 0, reinterpret_cast<LPARAM>(this));
|
||||
_windowManager->CloseWindow(this);
|
||||
}
|
||||
|
||||
void AppHost::_PropertyChangedHandler(const winrt::Windows::Foundation::IInspectable& /*sender*/,
|
||||
|
||||
@ -278,6 +278,16 @@ void WindowEmperor::CreateNewWindow(winrt::TerminalApp::WindowRequestedArgs args
|
||||
}
|
||||
}
|
||||
|
||||
void WindowEmperor::CloseWindow(AppHost* host) const
|
||||
{
|
||||
using namespace winrt::Windows::System;
|
||||
|
||||
const auto dispatcherQueue = DispatcherQueue::GetForCurrentThread();
|
||||
dispatcherQueue.TryEnqueue(DispatcherQueuePriority::Low, [hwnd = _window.get(), host]() {
|
||||
PostMessageW(hwnd, WM_CLOSE_TERMINAL_WINDOW, 0, reinterpret_cast<LPARAM>(host));
|
||||
});
|
||||
}
|
||||
|
||||
AppHost* WindowEmperor::_mostRecentWindow() const noexcept
|
||||
{
|
||||
int64_t max = INT64_MIN;
|
||||
|
||||
@ -34,6 +34,7 @@ public:
|
||||
AppHost* GetWindowById(uint64_t id) const noexcept;
|
||||
AppHost* GetWindowByName(std::wstring_view name) const noexcept;
|
||||
void CreateNewWindow(winrt::TerminalApp::WindowRequestedArgs args);
|
||||
void CloseWindow(AppHost* host) const;
|
||||
void HandleCommandlineArgs(int nCmdShow);
|
||||
|
||||
private:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user