SSR: do ui work on swing thread
(cherry picked from commit 5f41df9)