- Feature Description:
Right now, there is a way to check if the window is visible (isWindowVisibleToUser
), but there’s no event for when an OW window gains or loses focus. This is quite a reasonable thing to need, however, since apps may want to show different types of notifications, depending on whether or not the app is focused. For example, any chat app will show a system alert on an incoming message if not focused, but it shouldn’t if the window is focused; it’ll instead just show some in-app alert.
- impact for my app: [low, mid, high, show-stopper].
This is an annoyance and the current work around doesn’t actually allow us to know if the window is focused, so I’d say Mid-level impact for our app.
- What is your current pain point?
Currently, we’re using isWindowVisibleToUser
on a timer and assuming that the window is “focused” if it’s at least partially visible, but that’s neither accurate nor as responsive as it could be if there were this event. That means there can be a visible delay (around 1 second) when coming back to our app, since it may take us that long to poll again and see the window is now visible.
Knowing this is important for our app not only for the notification example above, but also because we show win animations once players come back to the app after a match. We don’t want to show the animation too soon, before the player is in the app again, but we also don’t want a 1 second delay while our timer triggers to see if the window is visible again. Also, just because the window is partially visible doesn’t mean the player is ready to view the animation.
- What do you have in mind to solve it?
Please add an overwolf.windows.onFocusChanged
, or similar event, which provides the window id and whether or not the window is now focused.
note for stuff: after FR is accepted, add a link to the internal ticket.