From 21a392341034169fff18db626e1c356545289af5 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 28 Nov 2019 13:41:07 +0100 Subject: Add an `OS.is_window_focused()` getter 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`. This partially addresses #33928. --- doc/classes/OS.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 6da0547352..df96954902 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -636,6 +636,14 @@ Returns [code]true[/code] if the window should always be on top of other windows. + + + + + Returns [code]true[/code] if the window is currently focused. + [b]Note:[/b] Only implemented on desktop platforms. On other platforms, it will always return [code]true[/code]. + + -- cgit v1.2.3