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.
This commit is contained in:
Hugo Locurcio 2019-11-28 13:41:07 +01:00
parent 7735af7e76
commit 21a3923410
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
10 changed files with 50 additions and 5 deletions

View file

@ -198,6 +198,7 @@ public:
virtual bool is_window_maximized() const;
virtual void set_window_always_on_top(bool p_enabled);
virtual bool is_window_always_on_top() const;
virtual bool is_window_focused() const;
virtual void request_attention();
virtual void center_window();
virtual void move_window_to_foreground();