Switching "show mouse cursor" from on to off loses focus in PIE window

Can you explain what the workaround is?

I’m actually toggling showing of mouse cursor on the player controller in C++ code when my guy hits the toggle show inventory key.

And this happens in Standalone for me under 4.7.