summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp5
-rw-r--r--core/bind/core_bind.h1
-rw-r--r--core/os/os.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 3b189be4ab..0eacffeb88 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -400,6 +400,10 @@ bool _OS::is_window_always_on_top() const {
return OS::get_singleton()->is_window_always_on_top();
}
+bool _OS::is_window_focused() const {
+ return OS::get_singleton()->is_window_focused();
+}
+
void _OS::set_borderless_window(bool p_borderless) {
OS::get_singleton()->set_borderless_window(p_borderless);
}
@@ -1226,6 +1230,7 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_window_maximized"), &_OS::is_window_maximized);
ClassDB::bind_method(D_METHOD("set_window_always_on_top", "enabled"), &_OS::set_window_always_on_top);
ClassDB::bind_method(D_METHOD("is_window_always_on_top"), &_OS::is_window_always_on_top);
+ ClassDB::bind_method(D_METHOD("is_window_focused"), &_OS::is_window_focused);
ClassDB::bind_method(D_METHOD("request_attention"), &_OS::request_attention);
ClassDB::bind_method(D_METHOD("get_real_window_size"), &_OS::get_real_window_size);
ClassDB::bind_method(D_METHOD("center_window"), &_OS::center_window);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 46a5fdb5a4..7c5031cad4 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -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();
diff --git a/core/os/os.h b/core/os/os.h
index cdc9536653..593ea2b645 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -222,6 +222,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() {}