Returning false calls unfreeze_keyboard() in mutter, while returning true just does nothing, making input unfreezing gala's problem, that's what ungrab_keyboard() is for. Following the documentation, ungrab_keyboard() should be called after handle_switch_input_source() returns true, but it seems to work great even if it's called before returning. So I'm not sure if we need ungrab_keyboard() and unfreeze_keyboard() (return false) or ungrab_keyboard() (return true) is enough.
Returning false calls unfreeze_keyboard() in mutter, while returning true just does nothing, making input unfreezing gala's problem, that's what ungrab_keyboard() is for. Following the documentation, ungrab_keyboard() should be called after handle_ switch_ input_source( ) returns true, but it seems to work great even if it's called before returning. So I'm not sure if we need ungrab_keyboard() and unfreeze_keyboard() (return false) or ungrab_keyboard() (return true) is enough.