master
Pietro Brenna 2020-04-09 10:34:06 +02:00
parent 2d247df1bb
commit e65b566e5a
1 changed files with 6 additions and 6 deletions

View File

@ -34,7 +34,7 @@ impl WindowState {
full: f, full: f,
position: p, position: p,
last_toggle: None, last_toggle: None,
focus_lost: None focus_lost: None,
})) }))
} }
} }
@ -165,19 +165,19 @@ pub fn esegui_toggle(
let ts = gtk::get_current_event_time(); let ts = gtk::get_current_event_time();
let pos = w_state.get_pos(); let pos = w_state.get_pos();
match pos { match pos {
Hidden | Hiding => { Hidden | Hiding => {
bring_up(window, w_state, ts); bring_up(window, w_state, ts);
crate::tabs::focus_current_tab(&nb); crate::tabs::focus_current_tab(&nb);
}, }
UpWithoutFocus => { UpWithoutFocus => {
let f_l = w_state.get_focus_lost() ; let f_l = w_state.get_focus_lost();
if f_l.is_some() && f_l.unwrap().elapsed() < Duration::from_millis(200) { if f_l.is_some() && f_l.unwrap().elapsed() < Duration::from_millis(200) {
hide(window, &w_state); hide(window, &w_state);
} else { } else {
bring_up(window, w_state, ts); bring_up(window, w_state, ts);
crate::tabs::focus_current_tab(&nb); crate::tabs::focus_current_tab(&nb);
} }
}, }
Up => hide(window, &w_state), Up => hide(window, &w_state),
_ => {} _ => {}
} }