Add ev_should_use_portal() copied from gtk+, which tries to find out whether the portal should be used.