mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Fix busy rendering when the same warning persists
When the same warning is thrown on the each rendering iteration, it'll force alacritty to always render. Co-authored-by: Christian Duerr <contact@christianduerr.com>
This commit is contained in:
parent
bf58748055
commit
66d742d059
2 changed files with 10 additions and 2 deletions
|
@ -1207,7 +1207,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
|
||||||
self.ctx.display.cursor_hidden = false;
|
self.ctx.display.cursor_hidden = false;
|
||||||
*self.ctx.dirty = true;
|
*self.ctx.dirty = true;
|
||||||
},
|
},
|
||||||
EventType::Message(message) => {
|
// Add message only if it's not already queued.
|
||||||
|
EventType::Message(message) if !self.ctx.message_buffer.is_queued(&message) => {
|
||||||
self.ctx.message_buffer.push(message);
|
self.ctx.message_buffer.push(message);
|
||||||
self.ctx.display.pending_update.dirty = true;
|
self.ctx.display.pending_update.dirty = true;
|
||||||
},
|
},
|
||||||
|
@ -1266,7 +1267,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
|
||||||
},
|
},
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
EventType::IpcConfig(_) => (),
|
EventType::IpcConfig(_) => (),
|
||||||
EventType::ConfigReload(_) | EventType::CreateWindow(_) => (),
|
EventType::ConfigReload(_) | EventType::CreateWindow(_) | EventType::Message(_) => {
|
||||||
|
},
|
||||||
},
|
},
|
||||||
WinitEvent::RedrawRequested(_) => *self.ctx.dirty = true,
|
WinitEvent::RedrawRequested(_) => *self.ctx.dirty = true,
|
||||||
WinitEvent::WindowEvent { event, .. } => {
|
WinitEvent::WindowEvent { event, .. } => {
|
||||||
|
|
|
@ -181,6 +181,12 @@ impl MessageBuffer {
|
||||||
pub fn push(&mut self, message: Message) {
|
pub fn push(&mut self, message: Message) {
|
||||||
self.messages.push_back(message);
|
self.messages.push_back(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Check whether the message is already queued in the message bar.
|
||||||
|
#[inline]
|
||||||
|
pub fn is_queued(&self, message: &Message) -> bool {
|
||||||
|
self.messages.contains(message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Reference in a new issue