From a5c69beabfc82d9c3f9563eb821139b2e0f3e14f Mon Sep 17 00:00:00 2001 From: Can Celik Date: Wed, 19 Aug 2026 04:43:28 +0300 Subject: fix(perf): eliminate redundant terminal wake work (#2962) * fix(perf): eliminate redundant terminal wake work * fix(perf): harden release benchmark gate * test(perf): strengthen performance guardrails --- src/app/state.rs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/app/state.rs') diff --git a/src/app/state.rs b/src/app/state.rs index b8205451..d9dcfc9d 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -1614,6 +1614,26 @@ impl AppState { section == SettingsSection::Integrations && self.integration_updates_available() } + pub(crate) fn app_surface_pane_ids(&self) -> std::collections::HashSet { + let mut pane_ids = std::collections::HashSet::new(); + if let Some(popup) = &self.popup_pane { + pane_ids.insert(popup.pane_id); + } + let Some(tab) = self + .active + .and_then(|ws_idx| self.workspaces.get(ws_idx)) + .and_then(crate::workspace::Workspace::active_tab) + else { + return pane_ids; + }; + if tab.zoomed { + pane_ids.insert(tab.layout.focused()); + } else { + pane_ids.extend(tab.panes.keys().copied()); + } + pane_ids + } + pub(crate) fn focused_pane_requests_mouse_capture_from( &self, terminal_runtimes: &crate::terminal::TerminalRuntimeRegistry, @@ -1622,8 +1642,7 @@ impl AppState { && self .active .and_then(|idx| self.focused_runtime_in_workspace(terminal_runtimes, idx)) - .and_then(crate::terminal::TerminalRuntime::input_state) - .is_some_and(crate::pane::InputState::mouse_reporting_enabled) + .is_some_and(crate::terminal::TerminalRuntime::mouse_reporting_enabled) } pub(crate) fn should_capture_host_mouse_from( -- cgit v1.2.3