aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alacritty/src/event.rs6
-rw-r--r--alacritty/src/message_bar.rs6
2 files changed, 10 insertions, 2 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 02309188..2ccd42cb 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -1207,7 +1207,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
self.ctx.display.cursor_hidden = false;
*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.display.pending_update.dirty = true;
},
@@ -1266,7 +1267,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
},
#[cfg(unix)]
EventType::IpcConfig(_) => (),
- EventType::ConfigReload(_) | EventType::CreateWindow(_) => (),
+ EventType::ConfigReload(_) | EventType::CreateWindow(_) | EventType::Message(_) => {
+ },
},
WinitEvent::RedrawRequested(_) => *self.ctx.dirty = true,
WinitEvent::WindowEvent { event, .. } => {
diff --git a/alacritty/src/message_bar.rs b/alacritty/src/message_bar.rs
index 988a6a31..267f8322 100644
--- a/alacritty/src/message_bar.rs
+++ b/alacritty/src/message_bar.rs
@@ -181,6 +181,12 @@ impl MessageBuffer {
pub fn push(&mut self, message: 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)]