It's not exactly common. In Belgium, the behavior is like when they thought it's really good or if people worked on a restaurant before.
But nobody expects that anyone would tip.
Last time I went to Hungary it was added to the bill though
Ps. A bottle of water is free in France and some other places.
Giving 50 cent for a restaurant when only using the bathroom is just a sign of good behavior in my view. Depends if I'm hurried, but I'll usually buy a glass of water. Then I'm a customer ;)