Skip to content

Add an `OS.is_window_focused()` getter

Created by: Calinou

This makes it possible to know whether the window is focused at a given time, without having to track the focus state manually using NOTIFICATION_WM_FOCUS_IN and NOTIFICATION_WM_FOCUS_OUT.

PS: I noticed Android makes use of those constants, but does it make sense to implement OS.is_window_focused() there? Can you run code in the game loop while the app is minimized?

This partially addresses #33928.

Merge request reports

Loading