If I understood you correctly, I think that only happens if you have set your game to start in exclusive full screen mode.
Implementing borderless fullscreen through window_set_showborder helps.
This extension can also be used for that, but you don’t have to unless you’re using the LTS version of GM.