1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 05:42:03 +03:00

Add close operation on macos

This commit is contained in:
Wez Furlong 2019-09-28 17:46:43 -07:00
parent 34f60dfa7f
commit 7e09492606
3 changed files with 17 additions and 1 deletions

View File

@ -330,7 +330,7 @@ impl TermWindow {
cloned_window.invalidate();
}
} else {
// TODO: destroy the window here
cloned_window.close();
}
},
);

View File

@ -135,6 +135,9 @@ pub trait WindowOps {
/// Hide a visible window
fn hide(&self);
/// Schedule the window to be closed
fn close(&self);
/// Change the cursor
fn set_cursor(&self, cursor: Option<MouseCursor>);
@ -161,6 +164,9 @@ pub trait WindowOpsMut {
/// Hide a visible window
fn hide(&mut self);
/// Schedule the window to be closed
fn close(&mut self);
/// Change the cursor
fn set_cursor(&mut self, cursor: Option<MouseCursor>);

View File

@ -116,6 +116,10 @@ impl Window {
}
impl WindowOps for Window {
fn close(&self) {
Connection::with_window_inner(self.0, |inner| inner.close());
}
fn hide(&self) {
Connection::with_window_inner(self.0, |inner| inner.hide());
}
@ -158,6 +162,12 @@ impl WindowOpsMut for WindowInner {
}
}
fn close(&mut self) {
unsafe {
self.window.close();
}
}
fn hide(&mut self) {}
fn set_cursor(&mut self, cursor: Option<MouseCursor>) {