Are you using g-sync monitor?
I always have this issue. When P3d is focused, it loses a lot of frames and it gains more frames when it's unfocused ( From Nvidia forum, this is because g-sync ).
Gsync must be active for full screen only, and that doesn't completely eliminate the problem, I am still having this issue.