Add on-focus event for OW windows

  • 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.

Hi @jeaye, and thanks for the feedback.

We will discuss the matter internally, and then we’ll update you.

Usually, it takes a few days. We will update you here.

Thanks.

following my conversation with @jeaye, we found out that the regular OnFocus/OnBlur events can be used to identify when an Overwolf window getting out of focus (blur).

closing the FR

This needs to be opened back up, @eransharv. Here is a video demonstrating the issue: https://upload.jeaye.com/okletsplay/video/ow-focus-demo.mp4

@jeaye I created a bug on this to the R&D. I will update you once it is handled.

internal bug ID: /issue/ODK-204