From 2ed679eb87fcd584021d5bf6789509508dd133fe Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 5 Aug 2024 16:44:31 +0200 Subject: [PATCH] Document expected coordinates in `PopupMenu.popup()` - Improve documentation related to embedded subwindows and single-window mode. - Add `minsize` keyword aliases for `popup_centered_clamped()` methods to ease migration to Godot 4.x (this was Godot 3.x terminology). --- doc/classes/EditorSettings.xml | 3 ++- doc/classes/ProjectSettings.xml | 4 +++- doc/classes/Window.xml | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index d63c71a351a..4d82a32dae6 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -719,7 +719,8 @@ [b]Note:[/b] If the editor was started with the [code]--debug-canvas-item-redraw[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url], the update spinner will [i]never[/i] display regardless of this setting's value. This is to avoid confusion with what would cause redrawing in real world scenarios. - If [code]true[/code], embed modal windows such as docks inside the main editor window. When single-window mode is enabled, tooltips will also be embedded inside the main editor window, which means they can't be displayed outside of the editor window. + If [code]true[/code], embed modal windows such as docks inside the main editor window. When single-window mode is enabled, tooltips will also be embedded inside the main editor window, which means they can't be displayed outside of the editor window. Single-window mode can be faster as it does not need to create a separate window for every popup and tooltip, which can be a slow operation depending on the operating system and rendering method in use. + This is equivalent to [member ProjectSettings.display/window/subwindows/embed_subwindows] in the running project, except the setting's value is inverted. [b]Note:[/b] To query whether the editor can use multiple windows in an editor plugin, use [method EditorInterface.is_multi_window_enabled] instead of querying the value of this editor setting. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 22c25dd5e57..b20b374382e 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -913,7 +913,9 @@ [b]Note:[/b] When using integer scaling with a stretch mode, resizing the window to be smaller than the base viewport size will clip the contents. Consider preventing that by setting [member Window.min_size] to the same value as the base viewport size defined in [member display/window/size/viewport_width] and [member display/window/size/viewport_height]. - If [code]true[/code] subwindows are embedded in the main window. + If [code]true[/code], subwindows are embedded in the main window (this is also called single-window mode). Single-window mode can be faster as it does not need to create a separate window for every popup and tooltip, which can be a slow operation depending on the operating system and rendering method in use. + If [code]false[/code], subwindows are created as separate windows (this is also called multi-window mode). This allows them to be moved outside the main window and use native operating system window decorations. + This is equivalent to [member EditorSettings.interface/editor/single_window_mode] in the editor, except the setting's value is inverted. Sets the V-Sync mode for the main game window. The editor's own V-Sync mode can be set using [member EditorSettings.interface/editor/vsync_mode]. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 286b35d6426..ca155881c8e 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -370,6 +370,9 @@ Shows the [Window] and makes it transient (see [member transient]). If [param rect] is provided, it will be set as the [Window]'s size. Fails if called on the main window. + If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]true[/code] (single-window mode), [param rect]'s coordinates are global and relative to the main window's top-left corner (excluding window decorations). If [param rect]'s position coordinates are negative, the window will be located outside the main window and may not be visible as a result. + If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]false[/code] (multi-window mode), [param rect]'s coordinates are global and relative to the top-left corner of the leftmost screen. If [param rect]'s position coordinates are negative, the window will be placed at the top-left corner of the screen. + [b]Note:[/b] [param rect] must be in global coordinates if specified. @@ -380,7 +383,7 @@ [b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size]. - + @@ -415,7 +418,7 @@ See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window]. - +