diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-11-30 10:28:16 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-12-07 11:07:30 +0200 |
commit | edf13eb5a635112c5df0aa81f11c8004274f62cf (patch) | |
tree | 26b77c0f327ddde12b8bfe161a22ac63685200cd /scene/main/window.cpp | |
parent | c241f1c52386b21cf2df936ee927740a06970db6 (diff) |
Rename `window_get_real_size` to `window_get_size_with_decorations`, add `window_get_position_with_decorations`.
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r-- | scene/main/window.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index aff2c594d9..73436b1658 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -106,9 +106,16 @@ void Window::reset_size() { set_size(Size2i()); } -Size2i Window::get_real_size() const { +Point2i Window::get_position_with_decorations() const { if (window_id != DisplayServer::INVALID_WINDOW_ID) { - return DisplayServer::get_singleton()->window_get_real_size(window_id); + return DisplayServer::get_singleton()->window_get_position_with_decorations(window_id); + } + return position; +} + +Size2i Window::get_size_with_decorations() const { + if (window_id != DisplayServer::INVALID_WINDOW_ID) { + return DisplayServer::get_singleton()->window_get_size_with_decorations(window_id); } return size; } @@ -1655,7 +1662,8 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("get_size"), &Window::get_size); ClassDB::bind_method(D_METHOD("reset_size"), &Window::reset_size); - ClassDB::bind_method(D_METHOD("get_real_size"), &Window::get_real_size); + ClassDB::bind_method(D_METHOD("get_position_with_decorations"), &Window::get_position_with_decorations); + ClassDB::bind_method(D_METHOD("get_size_with_decorations"), &Window::get_size_with_decorations); ClassDB::bind_method(D_METHOD("set_max_size", "max_size"), &Window::set_max_size); ClassDB::bind_method(D_METHOD("get_max_size"), &Window::get_max_size); |