Skip to content

Commit 6a10330

Browse files
committed
Merge pull request #95164 from Calinou/doc-window-popup-coordinates
Document expected coordinates in `PopupMenu.popup()`
2 parents e693ff8 + 2ed679e commit 6a10330

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

doc/classes/EditorSettings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@
719719
[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.
720720
</member>
721721
<member name="interface/editor/single_window_mode" type="bool" setter="" getter="">
722-
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.
722+
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.
723+
This is equivalent to [member ProjectSettings.display/window/subwindows/embed_subwindows] in the running project, except the setting's value is inverted.
723724
[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.
724725
</member>
725726
<member name="interface/editor/ui_layout_direction" type="int" setter="" getter="">

doc/classes/ProjectSettings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,9 @@
913913
[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].
914914
</member>
915915
<member name="display/window/subwindows/embed_subwindows" type="bool" setter="" getter="" default="true">
916-
If [code]true[/code] subwindows are embedded in the main window.
916+
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.
917+
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.
918+
This is equivalent to [member EditorSettings.interface/editor/single_window_mode] in the editor, except the setting's value is inverted.
917919
</member>
918920
<member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1">
919921
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].

doc/classes/Window.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@
370370
<param index="0" name="rect" type="Rect2i" default="Rect2i(0, 0, 0, 0)" />
371371
<description>
372372
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.
373+
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.
374+
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.
375+
[b]Note:[/b] [param rect] must be in global coordinates if specified.
373376
</description>
374377
</method>
375378
<method name="popup_centered">
@@ -380,7 +383,7 @@
380383
[b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size].
381384
</description>
382385
</method>
383-
<method name="popup_centered_clamped">
386+
<method name="popup_centered_clamped" keywords="minsize">
384387
<return type="void" />
385388
<param index="0" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />
386389
<param index="1" name="fallback_ratio" type="float" default="0.75" />
@@ -415,7 +418,7 @@
415418
See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
416419
</description>
417420
</method>
418-
<method name="popup_exclusive_centered_clamped">
421+
<method name="popup_exclusive_centered_clamped" keywords="minsize">
419422
<return type="void" />
420423
<param index="0" name="from_node" type="Node" />
421424
<param index="1" name="minsize" type="Vector2i" default="Vector2i(0, 0)" />

0 commit comments

Comments
 (0)