Backport of !1643 (merged) to GNOME 3.36
⚠ I did not pick the test in the backport (commit c94d9293), the code differs too much between master and 3.36, I do not think it's worth it.