summaryrefslogtreecommitdiff
path: root/core/os/os.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/os.h')
-rw-r--r--core/os/os.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/os/os.h b/core/os/os.h
index 5a2c998782..943c0498f1 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -205,6 +205,18 @@ public:
virtual void request_attention() {}
virtual void center_window();
+ // Returns window area free of hardware controls and other obstacles.
+ // The application should use this to determine where to place UI elements.
+ //
+ // Keep in mind the area returned is in window coordinates rather than
+ // viewport coordinates - you should perform the conversion on your own.
+ //
+ // The maximum size of the area is Rect2(0, 0, window_size.width, window_size.height).
+ virtual Rect2 get_window_safe_area() const {
+ Size2 window_size = get_window_size();
+ return Rect2(0, 0, window_size.width, window_size.height);
+ }
+
virtual void set_borderless_window(bool p_borderless) {}
virtual bool get_borderless_window() { return 0; }