mirror of
https://github.com/wez/wezterm.git
synced 2024-12-26 14:54:16 +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,
|
time: u32,
|
||||||
) {
|
) {
|
||||||
log::trace!("frame: CompositorHandler");
|
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 conn = WaylandConnection::get().unwrap().wayland();
|
||||||
let qh = conn.event_queue.borrow().handle();
|
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());
|
let callback = self.surface().frame(&qh, self.surface().clone());
|
||||||
|
|
||||||
log::trace!("do_paint - callback: {:?}", callback);
|
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);
|
self.frame_callback.replace(callback);
|
||||||
|
|
||||||
// The repaint has the side of effect of committing the surface,
|
// The repaint has the side of effect of committing the surface,
|
||||||
@ -576,6 +570,13 @@ impl WaylandWindowInner {
|
|||||||
.expect("Window should exist")
|
.expect("Window should exist")
|
||||||
.wl_surface()
|
.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 {
|
unsafe impl HasRawDisplayHandle for WaylandWindowInner {
|
||||||
|
Loading…
Reference in New Issue
Block a user