From 49890a99c16249736a89148bfc60c296187fe48a Mon Sep 17 00:00:00 2001 From: Arman Elgudzhyan <48544263+puchik@users.noreply.github.com> Date: Sat, 20 May 2023 14:48:24 -0700 Subject: [PATCH] Expose get_window_id() from Window class Window classes often need a Window ID for operations. This will help with performing operations on cached Windows. --- doc/classes/Window.xml | 6 ++++++ scene/main/window.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index bed40787969..3adc0d367db 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -194,6 +194,12 @@ See [method Control.get_theme_color] for details. + + + + Returns the ID of the window. + + diff --git a/scene/main/window.cpp b/scene/main/window.cpp index e2f9aa8937a..175c2848b4f 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -2478,6 +2478,8 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("set_title", "title"), &Window::set_title); ClassDB::bind_method(D_METHOD("get_title"), &Window::get_title); + ClassDB::bind_method(D_METHOD("get_window_id"), &Window::get_window_id); + ClassDB::bind_method(D_METHOD("set_initial_position", "initial_position"), &Window::set_initial_position); ClassDB::bind_method(D_METHOD("get_initial_position"), &Window::get_initial_position);