summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-11-28 13:41:07 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-11-28 16:42:51 +0100
commit21a392341034169fff18db626e1c356545289af5 (patch)
tree945dd4cd61bdfd052e9e9ec1302d0c9a977b4c19 /core/os
parent7735af7e768e16efb4b3b6de1c72c3dfb50c9412 (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 'core/os')
-rw-r--r--core/os/os.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/os/os.h b/core/os/os.h
index 687ccaaba5..d4d8a6f415 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -217,6 +217,7 @@ public:
virtual bool is_window_maximized() const { return true; }
virtual void set_window_always_on_top(bool p_enabled) {}
virtual bool is_window_always_on_top() const { return false; }
+ virtual bool is_window_focused() const { return true; }
virtual void set_console_visible(bool p_enabled) {}
virtual bool is_console_visible() const { return false; }
virtual void request_attention() {}