There are only 10 kinds of people in this world: those who know binary and those who don’t.
You should be able to just alt+left-click on mouse to move the toolbar/windows back on to the screen.
Or click on the workspace switcher and when zoomed out move them that way.
I'm guessing this is gimp in precise(2.6).
Gimp 2.8 has single-window mode.
It's available in a PPA
And yes, I have also seen this weird layout behavior.