diff --git a/window/src/os/wayland/window.rs b/window/src/os/wayland/window.rs index e6cd1d4f630..e17cba23648 100644 --- a/window/src/os/wayland/window.rs +++ b/window/src/os/wayland/window.rs @@ -544,6 +544,16 @@ impl WaylandWindowInner { return; } + // If the do_paint function has been called previously, calling it again will not + // send the NeedRepaint event. This results in the window not being displayed + // correctly. + // Therefore, when frame_callback is set to some, we need to send the NeedRepaint + // event again to ensure the window is displayed. + // Fix: https://github.com/wez/wezterm/issues/5103 + if self.frame_callback.is_some() { + self.events.dispatch(WindowEvent::NeedRepaint); + } + self.do_paint().unwrap(); }