From 59a735c5218b9aa7dbc51ccf088868b843883c31 Mon Sep 17 00:00:00 2001 From: daa Date: Sun, 9 Jul 2017 14:05:55 +0300 Subject: [PATCH] Fix quit by :q --- src/shell.rs | 2 +- src/ui.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index c39caee..6260d1d 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -34,7 +34,7 @@ pub const MINIMUM_SUPPORTED_NVIM_VERSION: &str = "0.2"; macro_rules! idle_cb_call { ($state:ident.$cb:ident($( $x:expr ),*)) => ( - gtk::idle_add(move || { + glib::idle_add(move || { if let Some(ref cb) = $state.borrow().$cb { (&mut *cb.borrow_mut())($($x),*); } diff --git a/src/ui.rs b/src/ui.rs index 0548775..f016ad3 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -125,7 +125,13 @@ impl Ui { shell.grab_focus(); let comps_ref = self.comps.clone(); - shell.set_detach_cb(Some(move || comps_ref.borrow().close_window())); + shell.set_detach_cb(Some(move || { + let comps_ref = comps_ref.clone(); + gtk::idle_add(move || { + comps_ref.borrow().close_window(); + Continue(false) + }); + })); } fn create_main_menu(&self, app: >k::Application) {