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

Code before:
                    // Clear config logs from message bar for all terminals.
                    for window_context in self.windows.values_mut() {
                        if !window_context.message_buffer.is_empty() {
                            window_context.message_buffer.remove_target(LOG_TARGET_CONFIG);
                            window_context.display.pending_update.dirty = true;
                        }
                    }

                    // Load config and update each terminal.
                    if let Ok(config) = config::reload(&path, &self.cli_options) {
                        let old_config = mem::replace(&mut self.config, config);

                        for window_context in self.windows.values_mut() {
                            window_context.update_config(&old_config, &self.config);
                        }
                    }
                },
                // Create a new terminal window.
                GlutinEvent::UserEvent(Event {
                    payload: EventType::CreateWindow(options), ..
                }) => {
                    #[cfg(not(any(target_os = "macos", windows)))]
                    for window_context in self.windows.values_mut() {
                        // The window is currently current, so redraw it on the next frame as well
                        // on Wayland, otherwise it could have the buffer of the old size, if
                        // resize happened.
                        if window_context.display.window.is_current() {
                            window_context.redraw_next = true;
                        }
                    }

                    if let Err(err) = self.create_window(event_loop, proxy.clone(), options) {
                        error!("Could not open window: {:?}", err);
                    }
                },
                // Process events affecting all windows.
                GlutinEvent::UserEvent(event @ Event { window_id: None, .. }) => {
                    for window_context in self.windows.values_mut() {
                        window_context.handle_event(
                            event_loop,
                            &proxy,
                            &mut self.config,
                            &mut clipboard,
                            &mut scheduler,
                            event.clone().into(),
                        );
                    }
                },
                // Process window-specific events.
                GlutinEvent::WindowEvent { window_id, .. }
                | GlutinEvent::UserEvent(Event { window_id: Some(window_id), .. })

Review comment (suggestion):
```suggestion
                        // The window's context is current, so redraw it on the next frame as well
                        // on Wayland, otherwise if a resize happened it could still have the buffer of the old size.
```

Code after:
                    // Clear config logs from message bar for all terminals.
                    for window_context in self.windows.values_mut() {
                        if !window_context.message_buffer.is_empty() {
                            window_context.message_buffer.remove_target(LOG_TARGET_CONFIG);
                            window_context.display.pending_update.dirty = true;
                        }
                    }

                    // Load config and update each terminal.
                    if let Ok(config) = config::reload(&path, &self.cli_options) {
                        let old_config = mem::replace(&mut self.config, config);

                        for window_context in self.windows.values_mut() {
                            window_context.update_config(&old_config, &self.config);
                        }
                    }
                },
                // Create a new terminal window.
                GlutinEvent::UserEvent(Event {
                    payload: EventType::CreateWindow(options), ..
                }) => {
                    // XXX Ensure that no context is current when creating a new window, otherwise
                    // it may lock the backing buffer of the surface of current context when asking
                    // e.g. EGL on Wayland to create a new context.
                    for window_context in self.windows.values_mut() {
                        window_context.display.window.make_not_current();
                    }

                    if let Err(err) = self.create_window(event_loop, proxy.clone(), options) {
                        error!("Could not open window: {:?}", err);
                    }
                },
                // Process events affecting all windows.
                GlutinEvent::UserEvent(event @ Event { window_id: None, .. }) => {
                    for window_context in self.windows.values_mut() {
                        window_context.handle_event(
                            event_loop,
                            &proxy,
                            &mut self.config,
                            &mut clipboard,
                            &mut scheduler,
                            event.clone().into(),
                        );
                    }
                },
                // Process window-specific events.
                GlutinEvent::WindowEvent { window_id, .. }
                | GlutinEvent::UserEvent(Event { window_id: Some(window_id), .. })
                | GlutinEvent::RedrawRequested(window_id) => {
                    if let Some(window_context) = self.windows.get_mut(&window_id) {
                        window_context.handle_event(