Issue Description:
We noticed while testing the changes discussed in Add on-focus event for OW windows that we were receiving OnFocus
events in the main window when a child window closes. But the main window is not actually focused.
Attached is a video showing the issue. Notice that the main window’s title bar will turn magenta when we receive an OnFocus
event and the console will also print a debug log on focus or blur. At the end of the video, the main window is not the focused window but has gained a focus event.
In our app specifically, we have a child, in-game window that can be opened and closed by the user via hotkeys. Manifest for our in-game window looks like:
"overlay": {
"transparent": true,
"desktop_only": false,
"in_game_only": true,
"clickthrough": false,
"mute": true,
"resizable": true,
"show_in_taskbar": false,
"disable_restore_animation": true,
"keep_window_location": true,
...
The issue does not appear to be limited to just in-game child windows though. I confirmed the same issue while testing the above as a desktop window, instead of in-game.
okletsplay-ow-focus-issue.mp4.zip (225.3 KB)
Steps to reproduce:
For our app specifically…
- Focus the main window by clicking anywhere in the app.
- Change focus to the game (Rocket League) by clicking anywhere in game.
- Change focus to the in-game window by clicking anywhere in the overlay window.
- Close the window via hotkeys.
- Notice that the main window has received an
OnFocus
event incorrectly.
Impact for my app: [low, mid, high, show-stopper]
High. It’s an annoyance as we depend on focus/blur events to know when the player has returned from a match so we can show a win animation. This is essential to our UX.