Check your shell startup files (.bash_profile, etc.) for something that might be setting DISPLAY incorrectly. If SSH sets up X forwarding, then it'll set DISPLAY to a correct value for you. There should be no need for you to set up DISPLAY yourself when forwarding X through SSH.
When an ssh connection creates an X11 forward, then the SSH server will set up a DISPLAY environment variable for any ssh sessions made through that connection. Typically, the value of display will be something like localhost:10.0. You might see an IP address instead of "localhost" if sshd is compiled to do that. The number "10" might be 11, 12, etc. if display 10 was already in use.
The number 10 comes from the sshd configuration option X11DisplayOffset. The default is 10, but it could be set to another number if someone had a reason to.
You say that gtk is trying and failing to connect to localhost:0.0. There are two reasons that could be happening:
- X11DisplayOffset is set to 0 on the server (the raspberry pi?) for some reason, AND the forwarding isn't working for some reason.
- Something in your shell startup files (.bash_profile, etc.) is overriding the DISPLAY value set by ssh with another, incorrect value.
You say that setting DISPLAY to 127.0.0.1:10.0 works. This means that sshd is probably using the default X11DisplayOffset. This implies that your problem is #2: Something in your shell startup files is incorrectly setting DISPLAY to localhost:0.0, overriding the correct DISPLAY value which the ssh server ought to be creating.