Fix building with DISABLE_UISERVER
(cherry picked from commit 2c62f3c40d5b52fd056e9ec673701ac93c669734)