UI: CPU running inside a thread

Handling window events.