add Tab::is_mouse_grabbed concept
refs: https://github.com/wez/wezterm/issues/106
This commit is contained in:
1 parent
f1846ab0ae
commit
5ba0c70cdb
5 files changed
+23
No files matched your search
@@ -103,6 +103,10 @@ impl Tab for LocalTab {
|
||||
let terminal = self.terminal.borrow();
|
||||
Some(terminal.get_selection_text())
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
self.terminal.borrow().is_mouse_grabbed()
|
||||
}
|
||||
}
|
||||
|
||||
impl LocalTab {
|
||||
|
||||
@@ -62,6 +62,12 @@ pub trait Tab: Downcast {
|
||||
fn palette(&self) -> ColorPalette;
|
||||
fn domain_id(&self) -> DomainId;
|
||||
|
||||
/// Returns true if the terminal has grabbed the mouse and wants to
|
||||
/// give the embedded application a chance to process events.
|
||||
/// In practice this controls whether the gui will perform local
|
||||
/// handling of clicks.
|
||||
fn is_mouse_grabbed(&self) -> bool;
|
||||
|
||||
fn set_clipboard(&self, _clipboard: &Arc<dyn Clipboard>) {}
|
||||
|
||||
/// Returns the selection range adjusted to the viewport
|
||||
|
||||
@@ -332,6 +332,11 @@ impl Tab for ClientTab {
|
||||
// FIXME: get selection from peer or the surface
|
||||
None
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
// FIXME: get the real state from the remote
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
struct RenderableInner {
|
||||
|
||||
@@ -331,6 +331,10 @@ impl Tab for TermWizTerminalTab {
|
||||
// FIXME: grab it from the surface
|
||||
None
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TermWizTerminal {
|
||||
|
||||
@@ -876,6 +876,10 @@ impl TerminalState {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_mouse_grabbed(&self) -> bool {
|
||||
self.sgr_mouse
|
||||
}
|
||||
|
||||
pub fn bracketed_paste_enabled(&self) -> bool {
|
||||
self.bracketed_paste
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user