Fix tooltip spamming redraw requests on FollowCursor

This commit is contained in:
Héctor Ramón Jiménez 2025-08-15 22:37:50 +02:00
parent 55a13f7232
commit d8f08e78c6
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -202,6 +202,7 @@ where
) {
let state = tree.state.downcast_mut::<State>();
let previous_state = *state;
let was_idle = *state == State::Idle;
*state = cursor
@ -214,7 +215,9 @@ where
if was_idle != is_idle {
shell.invalidate_layout();
shell.request_redraw();
} else if !is_idle && self.position == Position::FollowCursor {
} else if self.position == Position::FollowCursor
&& previous_state != *state
{
shell.request_redraw();
}