Prevent desktop only window grabbing focus on game lauch

Issue: Screen capture - 997227454b3407c47c185b6bab6f4659 - Gyazo

We currently have a game launch event for Classic WoW, and this is what happens currently. The desktop window will overtake the user’s screen on the game launch which is a bit disorienting.

My attempted solution to this problem was to remove the GameLauch event for Classic WoW, requiring users to open the app manually through the use of the cog wheel.

No Game Launch: Screen capture - c298d4769dc1862abb70ea30a5aef591 - Gyazo

This did prevent the overtaking of the screen, but for some reason when I removed the game launch event, it altered the behavior of the cog wheel. When you click on the cogwheel, it does load the app, but it doesn’t put the app on top like you would expect.

CoS: Keep the game launch event but prevent it from overlapping the game OR remove the game launch event without breaking the cogwheel functionality.

Adding here our slack thread for the record:

You:

I got it to stop overtaking the window by changing
“native_window”: false,
but because it’s not longer a native window, I lose the ability to resize the window even though
“resizable”: true,
is set. Digging into it more but almost there.

I wrote:

  • native window should be used only for desktop only windows. So if your window is in-game window - you should not set it as native.
  • the resizable:true will not work if your window is set to transparent: true , or if you define max_size and min_size with the same value

You replied:

Thanks for the replies, I’ll take a look at this later

So please update later. thanks

Our app is a desktop only window, so we would prefer to keep it as a native window.

My biggest confusion is why the cog wheel doesn’t bring the app to the front when clicked when I remove the gameLaunch event. Why does removing the gamLaunch event alter the behavior of the overwolf cog wheel?

I still need to try removing transparent and while native window is set to false just to see if that fixes the resize issue. I will try that in s bit.

Our fix for this was the remove GameLaunch event, and we added a window.bringToFront in our componentDidMount of our app so when a user clicks our app in the cogwheel it properly brings it to the front.

Thanks for the update! :slight_smile: