Repository: alacritty/alacritty
File: alacritty/src/event.rs (Rust)

Code before:
            GlutinEvent::UserEvent(Event { payload, .. }) => match payload {
                EventType::ScaleFactorChanged(scale_factor, (width, height)) => {
                    let display_update_pending = &mut self.ctx.display.pending_update;

                    // Push current font to update its scale factor.
                    let font = self.ctx.config.font.clone();
                    display_update_pending.set_font(font.with_size(*self.ctx.font_size));

                    // Resize to event's dimensions, since no resize event is emitted on Wayland.
                    display_update_pending.set_dimensions(PhysicalSize::new(width, height));

                    self.ctx.window().scale_factor = scale_factor;
                    *self.ctx.dirty = true;
                },
                EventType::SearchNext => self.ctx.goto_match(None),
                EventType::Scroll(scroll) => self.ctx.scroll(scroll),
                EventType::BlinkCursor => {
                    self.ctx.display.cursor_hidden ^= true;
                    *self.ctx.dirty = true;
                },
                EventType::BlinkCursorTimeout => {
                    // Disable blinking after timeout reached.
                    let timer_id = TimerId::new(Topic::BlinkCursor, self.ctx.display.window.id());
                    self.ctx.scheduler.unschedule(timer_id);
                    self.ctx.display.cursor_hidden = false;
                    *self.ctx.blink_cursor_timeout = true;
                    *self.ctx.dirty = true;
                },
                EventType::Message(message) => {
                    self.ctx.message_buffer.push(message);
                    self.ctx.display.pending_update.dirty = true;
                    *self.ctx.dirty = true;
                },
                EventType::Terminal(event) => match event {
                    TerminalEvent::Title(title) => {
                        if !self.ctx.preserve_title && self.ctx.config.window.dynamic_title {
                            self.ctx.window().set_title(title);
                        }
                    },
                    TerminalEvent::ResetTitle => {
                        let window_config = &self.ctx.config.window;
                        if window_config.dynamic_title {
                            self.ctx.display.window.set_title(window_config.identity.title.clone());
                        }
                    },
                    TerminalEvent::Wakeup => *self.ctx.dirty = true,
                    TerminalEvent::Bell => {
                        // Set window urgency.
                        if self.ctx.terminal.mode().contains(TermMode::URGENCY_HINTS) {
                            let focused = self.ctx.terminal.is_focused;
                            self.ctx.window().set_urgent(!focused);

Review comment (suggestion):
I think `cursor_blink_timed_out` might be a better variable name? Or something like that at least. `blink_cursor_timeout` as a flag name doesn't sit quite right with me.

Code after:
            GlutinEvent::UserEvent(Event { payload, .. }) => match payload {
                EventType::ScaleFactorChanged(scale_factor, (width, height)) => {
                    let display_update_pending = &mut self.ctx.display.pending_update;

                    // Push current font to update its scale factor.
                    let font = self.ctx.config.font.clone();
                    display_update_pending.set_font(font.with_size(*self.ctx.font_size));

                    // Resize to event's dimensions, since no resize event is emitted on Wayland.
                    display_update_pending.set_dimensions(PhysicalSize::new(width, height));

                    self.ctx.window().scale_factor = scale_factor;
                    *self.ctx.dirty = true;
                },
                EventType::SearchNext => self.ctx.goto_match(None),
                EventType::Scroll(scroll) => self.ctx.scroll(scroll),
                EventType::BlinkCursor => {
                    self.ctx.display.cursor_hidden ^= true;
                    *self.ctx.dirty = true;
                },
                EventType::BlinkCursorTimeout => {
                    // Disable blinking after timeout reached.
                    let timer_id = TimerId::new(Topic::BlinkCursor, self.ctx.display.window.id());
                    self.ctx.scheduler.unschedule(timer_id);
                    self.ctx.display.cursor_hidden = false;
                    *self.ctx.cursor_blink_timed_out = true;
                    *self.ctx.dirty = true;
                },
                EventType::Message(message) => {
                    self.ctx.message_buffer.push(message);
                    self.ctx.display.pending_update.dirty = true;
                    *self.ctx.dirty = true;
                },
                EventType::Terminal(event) => match event {
                    TerminalEvent::Title(title) => {
                        if !self.ctx.preserve_title && self.ctx.config.window.dynamic_title {
                            self.ctx.window().set_title(title);
                        }
                    },
                    TerminalEvent::ResetTitle => {
                        let window_config = &self.ctx.config.window;
                        if window_config.dynamic_title {
                            self.ctx.display.window.set_title(window_config.identity.title.clone());
                        }
                    },
                    TerminalEvent::Wakeup => *self.ctx.dirty = true,
                    TerminalEvent::Bell => {
                        // Set window urgency.
                        if self.ctx.terminal.mode().contains(TermMode::URGENCY_HINTS) {
                            let focused = self.ctx.terminal.is_focused;
                            self.ctx.window().set_urgent(!focused);