The bug is basically as follows: after switching network connections via
NetworkManager (maybe in combination with hibernate/resume, I'm not sure
about that yet), suddenly every window takes about 10 seconds to open
while waiting for gnome-session to respond.
I've done various ltraces and straces of gnome-session and some
applications.
The applications themselves hang in, e.g. XtOpenApplication (in case of
Xterm) or gnome_program_init (in case of gedit, for example).
At the same time, gnome-session hangs in SmsGenerateClientID. strace
shows that it seems to be waiting for a DNS reply from a long-gone DNS
server for the local hostname..