And here’s the fix!
This commit is contained in:
parent
acf30d1001
commit
b63ab3a2ef
14
src/main.rs
14
src/main.rs
@ -60,12 +60,15 @@ fn main() {
|
||||
let timer_handle = source.handle();
|
||||
timer_handle.add_timeout(std::time::Duration::from_secs(1), "");
|
||||
|
||||
handle.insert_source(source, |_, timer_handle, _| {
|
||||
println!("Redraw!");
|
||||
redraw(&mut pool, window.surface(), dimensions).expect("Failed to draw");
|
||||
window.refresh();
|
||||
handle.insert_source(source, |_, timer_handle, event| {
|
||||
println!("Elapsed!");
|
||||
timer_handle.add_timeout(std::time::Duration::from_secs(1), "");
|
||||
});
|
||||
if event.is_none() {
|
||||
*event = Some(sctk::window::Event::Refresh);
|
||||
} else {
|
||||
println!("not none");
|
||||
}
|
||||
}).unwrap();
|
||||
|
||||
sctk::WaylandSource::new(queue).quick_insert(handle).unwrap();
|
||||
|
||||
@ -74,6 +77,7 @@ fn main() {
|
||||
match next_action.take() {
|
||||
Some(WEvent::Close) => break,
|
||||
Some(WEvent::Refresh) => {
|
||||
println!("Refresh!");
|
||||
window.refresh();
|
||||
window.surface().commit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user