Use additional create_custom_surface function.
Do not send events to destroyed input method contexts.