Apps open outside displays on external monitors (Yosemite iMac 27" 3.4ghz i7)
i have the same problem, i noticed that it happen if i start or resume my mac with the external display connected, if i connect it after the mac is wake up it behave normally.

Probably it fail to detect the correct setting for monitor during startup (or something messed it up as wake up)

So not a fix but at least you can work..