mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 06:54:45 +03:00
Add pane_focus_follows_mouse
closes: https://github.com/wez/wezterm/issues/600
This commit is contained in:
parent
657ed92d82
commit
d705886b53
@ -1067,6 +1067,9 @@ pub struct Config {
|
||||
|
||||
#[serde(default)]
|
||||
pub swallow_mouse_click_on_pane_focus: bool,
|
||||
|
||||
#[serde(default)]
|
||||
pub pane_focus_follows_mouse: bool,
|
||||
}
|
||||
impl_lua_conversion!(Config);
|
||||
|
||||
|
@ -34,6 +34,7 @@ As features stabilize some brief notes about them will accumulate here.
|
||||
* Fixed: potential panic when word selecting off top of viewport [#713](https://github.com/wez/wezterm/issues/713)
|
||||
* Fixed: really long busy wait when displaying single logical json line of 1.5MB in length [#714](https://github.com/wez/wezterm/issues/714)
|
||||
* New: [swallow_mouse_click_on_pane_focus](config/lua/config/swallow_mouse_click_on_pane_focus.md) option [#724](https://github.com/wez/wezterm/issues/724)
|
||||
* New: [pane_focus_follows_mouse](config/lua/config/pane_focus_follows_mouse.md) option [#600](https://github.com/wez/wezterm/issues/600)
|
||||
|
||||
### 20210405-110924-a5bb5be8
|
||||
|
||||
|
11
docs/config/lua/config/pane_focus_follows_mouse.md
Normal file
11
docs/config/lua/config/pane_focus_follows_mouse.md
Normal file
@ -0,0 +1,11 @@
|
||||
# `pane_focus_follows_mouse = false`
|
||||
|
||||
*Since: nightly builds only*
|
||||
|
||||
When `pane_focus_follows_mouse = true`, moving the mouse pointer over an
|
||||
inactive pane will cause that pane to activate; this behavior is known
|
||||
as "focus follows mouse".
|
||||
|
||||
When `pane_focus_follows_mouse = false` (the default), you need to click
|
||||
on an inactive pane to activate it.
|
||||
|
@ -340,7 +340,16 @@ impl super::TermWindow {
|
||||
pane = Rc::clone(&pos.pane);
|
||||
is_click_to_focus = true;
|
||||
}
|
||||
WMEK::Move => {}
|
||||
WMEK::Move => {
|
||||
if self.config.pane_focus_follows_mouse {
|
||||
let mux = Mux::get().unwrap();
|
||||
mux.get_active_tab_for_window(self.mux_window_id)
|
||||
.map(|tab| tab.set_active_idx(pos.index));
|
||||
|
||||
pane = Rc::clone(&pos.pane);
|
||||
context.invalidate();
|
||||
}
|
||||
}
|
||||
WMEK::Release(_) => {}
|
||||
WMEK::VertWheel(_) => {}
|
||||
WMEK::HorzWheel(_) => {}
|
||||
|
Loading…
Reference in New Issue
Block a user