client: make gtk widgets thread-safe
server: finally repair direction flag