1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

window: impl close for Windows

This commit is contained in:
Wez Furlong 2019-09-28 21:16:08 -07:00
parent d44f380a82
commit 1c5f20f5e5

View File

@ -207,6 +207,16 @@ fn schedule_show_window(hwnd: HWindow, show: bool) {
}
impl WindowOpsMut for WindowInner {
fn close(&mut self) {
let hwnd = self.hwnd;
Future::with_executor(Connection::executor(), move || {
unsafe {
DestroyWindow(hwnd.0);
}
Ok(())
});
}
fn show(&mut self) {
schedule_show_window(self.hwnd, true);
}
@ -234,6 +244,10 @@ impl WindowOpsMut for WindowInner {
}
impl WindowOps for Window {
fn close(&self) {
Connection::with_window_inner(self.0, |inner| inner.close());
}
fn show(&self) {
schedule_show_window(self.0, true);
}