canonical / ubuntu-frame

The foundation for many embedded graphical display implementations
GNU General Public License v3.0
156 stars 21 forks source link

Draw the background/diagnostic on the worker thread #152

Closed AlanGriffiths closed 11 months ago

AlanGriffiths commented 11 months ago

We've been mostly getting away with drawing and flushing on random threads because these windows are rarely updated and we get consistency by dumb luck.

But if the timing is "just right" (see #151) all hell breaks loose.

Clearly there was a time when we thought about which calls need to be on the worker thread, because there was a semaphore to cause a flush, but that wasn't being used by the current code. (Logically, it should have been used in FullscreenClient::draw() as that doesn't run on the worker thread, but that doesn't actually fix #151 because wl_surface_attach() fails.)

Anyway, as we're not using flush_signal, and draw_screen() needs to be called on the worker thread, and the only place that isn't true is draw(), we can replace it with a draw_signal and do everything right.

Fixes: #151