summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2022-04-26 11:40:57 +0200
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2022-05-02 09:31:32 +0200
commit97e87a2daf27ff250e748cb25a29f1c91879c709 (patch)
tree2d033d6216df1a1d8a2df50cd44a0389ed35ed30 /servers
parentbc7ccc909bb81334124fb24a771e148991fb0b3a (diff)
Fix screen_get_usable_rect returning display safe area
Diffstat (limited to 'servers')
-rw-r--r--servers/display_server.cpp1
-rw-r--r--servers/display_server.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp
index e68fcc184e..23961e0ca4 100644
--- a/servers/display_server.cpp
+++ b/servers/display_server.cpp
@@ -580,6 +580,7 @@ void DisplayServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("clipboard_get_primary"), &DisplayServer::clipboard_get_primary);
ClassDB::bind_method(D_METHOD("get_display_cutouts"), &DisplayServer::get_display_cutouts);
+ ClassDB::bind_method(D_METHOD("get_display_safe_area"), &DisplayServer::get_display_safe_area);
ClassDB::bind_method(D_METHOD("get_screen_count"), &DisplayServer::get_screen_count);
ClassDB::bind_method(D_METHOD("screen_get_position", "screen"), &DisplayServer::screen_get_position, DEFVAL(SCREEN_OF_MAIN_WINDOW));
diff --git a/servers/display_server.h b/servers/display_server.h
index 64340cff73..136f95a74f 100644
--- a/servers/display_server.h
+++ b/servers/display_server.h
@@ -229,6 +229,7 @@ public:
virtual String clipboard_get_primary() const;
virtual Array get_display_cutouts() const { return Array(); }
+ virtual Rect2i get_display_safe_area() const { return screen_get_usable_rect(); }
enum {
SCREEN_OF_MAIN_WINDOW = -1