View Single Post
Old 08-18-2022, 08:10 AM   #874
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 446
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by Barty View Post
Is there a way to tell when the screen is done updating?
You can wait for an update to complete with the wait function. So in process_render_queue, instead of:
Code:
	match context.fb.update(&rect, mode) {
		…
	}
you could write:
Code:
if mode == Update::Full && context.fb.inverted() && context.settings.frontlight {
	context.set_frontlight(false);
	// TODO: log the errors.
	if let Ok(token) = context.fb.update(&rect, mode) {
		context.fb.wait(token).ok();
	}
	context.set_frontlight(true);
} else {
	match context.fb.update(&rect, mode) {
		…
	}
}

Last edited by baskerville; 08-18-2022 at 10:45 AM.
baskerville is offline   Reply With Quote