jpreiss/pypdfdeck

Only draw when necessary

Closed this issue · 2 comments

We use an interval-scheduled function to poll the keyboard and implement key repeat manually.

Annoyingly, Pyglet always redraws windows once you add an interval-scheduled function to the clock. There does not appear to be any path whereby the scheduled function can inform the main loop if it actually wants a redraw or not.

We need some other way to implement keyboard polling without triggering redraws, and also some way to continuous redraws during dissolve animations.

db8d3ae did not reduce the CPU/energy usage significantly according to Activity Monitor on my 2013 rMPB, but it still seems to reduce the fan usage significantly.

Looks like fixing the queue busy poll in dd68b2a also helped a lot with energy usage. tried ablation, the slow tick is still important.