In Elementary 5 (Hera) this can happen when gala (the window manager) crashes. You can recover from a situation like this without rebooting by running:
setsid ibus-daemon &
setsid gala --replace &
The first command, ibus-daemon starts the ibus daemon, which likely is needed because it's no longer running - you can verify that before ...