mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 22:01:47 +03:00
wayland: fix webgpu invalidation issue
For whatever reason, it appears as though the wayland frame event stuff is unreliable when used with webgpu, so we simply avoid using it. refs: https://github.com/wez/wezterm/issues/3126
This commit is contained in:
parent
6bd3664d3d
commit
36d5307b80
@ -131,6 +131,9 @@ As features stabilize some brief notes about them will accumulate here.
|
||||
take precedence over built-in rules. #3456
|
||||
* Painted pane background color behind the tab bar when there was only one
|
||||
pane. Matters when the tab bar is transparent! #3450
|
||||
* Wayland: window not repainting consistently when using the keyboard when
|
||||
using `front_end="WebGpu"`. Thanks to @jokeyrhyme for working through
|
||||
different iterations of this fix! #3126
|
||||
|
||||
### 20230326-111934-3666303c
|
||||
|
||||
|
@ -803,17 +803,25 @@ impl WaylandWindowInner {
|
||||
self.invalidated = false;
|
||||
self.events.dispatch(WindowEvent::NeedRepaint);
|
||||
|
||||
// Ask the compositor to wake us up when its time to paint
|
||||
// the next frame
|
||||
let window_id = self.window_id;
|
||||
let callback = self.surface.frame();
|
||||
callback.quick_assign(move |_source, _event, _data| {
|
||||
WaylandConnection::with_window_inner(window_id, |inner| {
|
||||
inner.next_frame_is_ready();
|
||||
Ok(())
|
||||
if self.gl_state.is_some() {
|
||||
// Ask the compositor to wake us up when it is time to paint
|
||||
// the next frame.
|
||||
// We don't do this when we're using WebGPU because we don't
|
||||
// always get a timely wakeup. We configure wgpu to use a
|
||||
// vsync-equivalent PresentMode so we should already be
|
||||
// respecting the maximum frame rate, making it less critical
|
||||
// to rely on Wayland's frame scheduling.
|
||||
// <https://github.com/wez/wezterm/issues/3126>
|
||||
let window_id = self.window_id;
|
||||
let callback = self.surface.frame();
|
||||
callback.quick_assign(move |_source, _event, _data| {
|
||||
WaylandConnection::with_window_inner(window_id, |inner| {
|
||||
inner.next_frame_is_ready();
|
||||
Ok(())
|
||||
});
|
||||
});
|
||||
});
|
||||
self.frame_callback.replace(callback);
|
||||
self.frame_callback.replace(callback);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user