Optimized window drawing in applib