Avoid redraw spam when tooltip follows cursor
This commit is contained in:
parent
25a96f8efc
commit
d47c921b29
1 changed files with 4 additions and 1 deletions
|
|
@ -203,6 +203,7 @@ where
|
|||
) {
|
||||
if let Event::Mouse(_) = event {
|
||||
let state = tree.state.downcast_mut::<State>();
|
||||
let previous_state = *state;
|
||||
let was_idle = *state == State::Idle;
|
||||
|
||||
*state = cursor
|
||||
|
|
@ -215,7 +216,9 @@ where
|
|||
if was_idle != is_idle {
|
||||
shell.invalidate_layout();
|
||||
shell.request_redraw();
|
||||
} else if self.position == Position::FollowCursor {
|
||||
} else if self.position == Position::FollowCursor
|
||||
&& *state != previous_state
|
||||
{
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue