diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-11-28 13:41:07 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-11-28 16:42:51 +0100 |
commit | 21a392341034169fff18db626e1c356545289af5 (patch) | |
tree | 945dd4cd61bdfd052e9e9ec1302d0c9a977b4c19 /doc | |
parent | 7735af7e768e16efb4b3b6de1c72c3dfb50c9412 (diff) |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/OS.xml | 8 |
1 files changed, 8 insertions, 0 deletions
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. </description> </method> + <method name="is_window_focused" qualifiers="const"> + <return type="bool"> + </return> + <description> + 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]. + </description> + </method> <method name="kill"> <return type="int" enum="Error"> </return> |