I hade some trouble with this as well so I created a script that keeps the window active and maximized.
Hope it can help others :)
https://github.com/william-andersson/rpie_run
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.