mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 22:33:52 +03:00
A window renders now
This commit is contained in:
parent
9e14a4c929
commit
4ce398bc19
@ -206,7 +206,13 @@ impl CompositorHandler for WaylandState {
|
||||
time: u32,
|
||||
) {
|
||||
log::trace!("frame: CompositorHandler");
|
||||
todo!()
|
||||
let surface_data = SurfaceUserData::from_wl(surface);
|
||||
let window_id = surface_data.window_id;
|
||||
|
||||
WaylandConnection::with_window_inner(window_id, |inner| {
|
||||
inner.next_frame_is_ready();
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -547,16 +547,10 @@ impl WaylandWindowInner {
|
||||
|
||||
let conn = WaylandConnection::get().unwrap().wayland();
|
||||
let qh = conn.event_queue.borrow().handle();
|
||||
// TODO: is this the current udata to pass in?, just following examples
|
||||
|
||||
let callback = self.surface().frame(&qh, self.surface().clone());
|
||||
|
||||
log::trace!("do_paint - callback: {:?}", callback);
|
||||
// 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);
|
||||
|
||||
// The repaint has the side of effect of committing the surface,
|
||||
@ -576,6 +570,13 @@ impl WaylandWindowInner {
|
||||
.expect("Window should exist")
|
||||
.wl_surface()
|
||||
}
|
||||
|
||||
pub(crate) fn next_frame_is_ready(&mut self) {
|
||||
self.frame_callback.take();
|
||||
if self.invalidated {
|
||||
self.do_paint().ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl HasRawDisplayHandle for WaylandWindowInner {
|
||||
|
Loading…
Reference in New Issue
Block a user