I would say
"I opened the window, and my cat jumped out", or "I had just opened the window when my cat jumped out". The actions are rather simultaneous, if I know cats well?
As to the sentences with when + past perfect, it would be easier (to me at least) with "once". Maybe "when we had...