aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/state.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 16:37:50 +0300
committerGitHub <noreply@github.com>2026-09-10 16:37:50 +0300
commit90e947a6e26e02f10ec7f1694c4eb5b78a86406b (patch)
tree773c5e6e45031a55b6a32cc731944c6e65e19f33 /src/client/shell/state.rs
parentbf76cef889257a56b29f892816cff827b34c23da (diff)
fix: bound mouse selection repaint cadence (#3901)
refs #3895
Diffstat (limited to 'src/client/shell/state.rs')
-rw-r--r--src/client/shell/state.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/shell/state.rs b/src/client/shell/state.rs
index add297e2..60afc3df 100644
--- a/src/client/shell/state.rs
+++ b/src/client/shell/state.rs
@@ -922,6 +922,8 @@ pub(crate) struct ClientShellState {
pub(super) reveal_focused_tab: bool,
pub(super) last_tab_bar_width: Option<u16>,
pub(super) last_composed_size: Option<(u16, u16)>,
+ pub(super) last_composed_at: Option<std::time::Instant>,
+ pub(super) selection_repaint_deadline: Option<std::time::Instant>,
pub(super) hits: ShellHitMap,
pub(super) endpoints: Vec<ClientShellEndpoint>,
pub(super) active_endpoint_id: ClientEndpointId,
@@ -1078,6 +1080,8 @@ impl ClientShellState {
reveal_focused_tab: true,
last_tab_bar_width: None,
last_composed_size: None,
+ last_composed_at: None,
+ selection_repaint_deadline: None,
hits: ShellHitMap::default(),
endpoints: vec![local_endpoint()],
active_endpoint_id: ClientEndpointId::Local,
@@ -1258,6 +1262,8 @@ impl ClientShellState {
self.reveal_focused_tab = true;
self.last_tab_bar_width = None;
self.last_composed_size = None;
+ self.last_composed_at = None;
+ self.selection_repaint_deadline = None;
self.pending_requests.clear();
self.pane_scroll_in_flight.clear();
self.pane_scroll_queued.clear();
@@ -1823,6 +1829,9 @@ impl ClientShellState {
pub(crate) fn timer_delay(&self, now: std::time::Instant) -> std::time::Duration {
let default = std::time::Duration::from_millis(100);
self.selection_autoscroll_deadline
+ .into_iter()
+ .chain(self.selection_repaint_deadline)
+ .min()
.map(|deadline| deadline.saturating_duration_since(now).min(default))
.unwrap_or(default)
}