Additional info: This bug seems to be related to upstream bug #12253: https://bugzilla.xfce.org/show_bug.cgi?id=12253
So I've downgraded glib-2.0 to the previous testing package (libglib2.0-0_2.44.1-1.1_amd64.deb from snapshot.d.o) and I found that the bug is not present with that version. Then I upgraded to glib 2.46 again, and the bug reappears.