term: enable DECSET 1004 Focus Reporting
This is enabled only for local terminals for now; the multiplexer protocol will need to be extended to carry this signal.
This commit is contained in:
1 parent
e4fb68bb22
commit
4e6357b218
5 files changed
+37
-4
No files matched your search
@@ -320,6 +320,10 @@ impl WindowCallbacks for TermWindow {
|
||||
|
||||
// force cursor to be repainted
|
||||
self.window.as_ref().unwrap().invalidate();
|
||||
|
||||
if let Some(tab) = self.get_active_tab_or_overlay() {
|
||||
tab.focus_changed(focused);
|
||||
}
|
||||
}
|
||||
|
||||
fn mouse_event(&mut self, event: &MouseEvent, context: &dyn WindowOps) {
|
||||
@@ -1216,10 +1220,19 @@ impl TermWindow {
|
||||
tab_idx as usize
|
||||
};
|
||||
|
||||
if let Some(tab) = self.get_active_tab_or_overlay() {
|
||||
tab.focus_changed(false);
|
||||
}
|
||||
|
||||
if tab_idx < max {
|
||||
window.set_active(tab_idx);
|
||||
|
||||
drop(window);
|
||||
|
||||
if let Some(tab) = self.get_active_tab_or_overlay() {
|
||||
tab.focus_changed(false);
|
||||
}
|
||||
|
||||
self.update_title();
|
||||
self.update_scrollbar();
|
||||
}
|
||||
|
||||
@@ -94,6 +94,10 @@ impl Tab for LocalTab {
|
||||
self.terminal.borrow_mut().erase_scrollback();
|
||||
}
|
||||
|
||||
fn focus_changed(&self, focused: bool) {
|
||||
self.terminal.borrow_mut().focus_changed(focused);
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
self.terminal.borrow().is_mouse_grabbed()
|
||||
}
|
||||
|
||||
@@ -102,6 +102,9 @@ pub trait Tab: Downcast {
|
||||
|
||||
fn erase_scrollback(&self) {}
|
||||
|
||||
/// Called to advise on whether this tab has focus
|
||||
fn focus_changed(&self, _focused: bool) {}
|
||||
|
||||
/// Performs a search.
|
||||
/// If the result is empty then there are no matches.
|
||||
/// Otherwise, the result shall contain all possible matches.
|
||||
|
||||
Reference in new issue
Block a user