Merge branch 'master' into ext_cmdline

This commit is contained in:
daa 2018-02-23 14:17:18 +03:00
commit 49bb758c4b

View File

@ -77,7 +77,10 @@ pub struct State {
cmd_line: CmdLine,
settings: Rc<RefCell<Settings>>,
render_state: Rc<RefCell<RenderState>>,
resize_request: (i64, i64),
resize_timer: Rc<Cell<Option<glib::SourceId>>>,
pub clipboard_clipboard: gtk::Clipboard,
pub clipboard_primary: gtk::Clipboard,
@ -112,7 +115,10 @@ impl State {
cmd_line,
settings,
render_state,
resize_request: (-1, -1),
resize_timer: Rc::new(Cell::new(None)),
clipboard_clipboard: gtk::Clipboard::get(&gdk::Atom::intern("CLIPBOARD")),
clipboard_primary: gtk::Clipboard::get(&gdk::Atom::intern("PRIMARY")),
@ -302,11 +308,19 @@ impl State {
return;
}
let (requested_rows, requested_cols) = self.resize_request;
if requested_rows == rows as i64 && requested_cols == columns as i64 {
return;
}
let resize_timer = self.resize_timer.take();
if let Some(resize_timer) = resize_timer {
glib::source_remove(resize_timer);
}
self.resize_request = (rows as i64, columns as i64);
let nvim = self.nvim.clone();
let resize_timer = self.resize_timer.clone();