Reduce consecutive RedrawRequested handled to 3
This commit is contained in:
parent
e9f1ac2c2a
commit
3b9900aa27
1 changed files with 5 additions and 5 deletions
|
|
@ -842,7 +842,7 @@ async fn run_instance<P>(
|
||||||
.expect("Get user interface");
|
.expect("Get user interface");
|
||||||
|
|
||||||
let interact_span = debug::interact(id);
|
let interact_span = debug::interact(id);
|
||||||
let mut change_count = 0;
|
let mut redraw_count = 0;
|
||||||
|
|
||||||
let state = loop {
|
let state = loop {
|
||||||
let message_count = messages.len();
|
let message_count = messages.len();
|
||||||
|
|
@ -854,23 +854,23 @@ async fn run_instance<P>(
|
||||||
&mut messages,
|
&mut messages,
|
||||||
);
|
);
|
||||||
|
|
||||||
change_count += 1;
|
|
||||||
|
|
||||||
if message_count == messages.len()
|
if message_count == messages.len()
|
||||||
&& !state.has_layout_changed()
|
&& !state.has_layout_changed()
|
||||||
{
|
{
|
||||||
break state;
|
break state;
|
||||||
}
|
}
|
||||||
|
|
||||||
if change_count >= 10 {
|
if redraw_count >= 2 {
|
||||||
log::warn!(
|
log::warn!(
|
||||||
"More than 10 consecutive RedrawRequested events \
|
"More than 3 consecutive RedrawRequested events \
|
||||||
produced layout invalidation"
|
produced layout invalidation"
|
||||||
);
|
);
|
||||||
|
|
||||||
break state;
|
break state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redraw_count += 1;
|
||||||
|
|
||||||
if !messages.is_empty() {
|
if !messages.is_empty() {
|
||||||
let caches: FxHashMap<_, _> =
|
let caches: FxHashMap<_, _> =
|
||||||
ManuallyDrop::into_inner(user_interfaces)
|
ManuallyDrop::into_inner(user_interfaces)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue