Paste to window which had focus before menu popup

Cleaned up PlatformNativeInterface.