X Tutup
Skip to content

EditorRun: Load override.cfg to get window configuration for embedded mode#111847

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
akien-mga:akien/embedded-run-respect-override
Oct 22, 2025
Merged

EditorRun: Load override.cfg to get window configuration for embedded mode#111847
Repiteo merged 1 commit intogodotengine:masterfrom
akien-mga:akien/embedded-run-respect-override

Conversation

@akien-mga
Copy link
Member

Fixes #111846.

@akien-mga akien-mga added this to the 4.6 milestone Oct 20, 2025
@akien-mga akien-mga requested a review from a team October 20, 2025 14:33
@akien-mga akien-mga added bug topic:editor cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Oct 20, 2025
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should respect application/config/disable_project_settings_override project setting, for consistency with project running without editor.

@akien-mga akien-mga force-pushed the akien/embedded-run-respect-override branch from d4dab62 to 42000e2 Compare October 20, 2025 14:59
@akien-mga
Copy link
Member Author

This probably should respect application/config/disable_project_settings_override project setting, for consistency with project running without editor.

Done.

@ydeltastar
Copy link
Contributor

I don't think this is the correct fix.

override.cfg works the same as the regular settings so the correct way of affecting the embedded mode is be using the editor_hint feature tag.
I do this at the settings in my project where I have both window_width_override=1920 and window_width_override.editor_hint=960 so the window is smaller only when running in embedded mode.

I want to do the same with override.cfg but it doesn't works in master and doesn't seems to work with this PR too.

@akien-mga
Copy link
Member Author

I don't think this is the correct fix.

override.cfg works the same as the regular settings so the correct way of affecting the embedded mode is be using the editor_hint feature tag. I do this at the settings in my project where I have both window_width_override=1920 and window_width_override.editor_hint=960 so the window is smaller only when running in embedded mode.

I want to do the same with override.cfg but it doesn't works in master and doesn't seems to work with this PR too.

That's a different use case from what I describe in #111846 though.

I don't want to modify the project.godot file, because these settings are meant to be hot-swapped by different team members on their local clone of the project to test different configurations.

And I don't want things to behave differently in the embedded mode and in the non-embedded mode. Using .editor_hint achieves that but that's not what I want to do, I want to have the same behavior (respect override.cfg) regardless of the run mode. The reason it doesn't work currently is just that #55230 disabled loading override.cfg in the editor as it would overwrite settings in project.godot, which is also not desired.

@ydeltastar
Copy link
Contributor

ydeltastar commented Oct 20, 2025

I want to have the same behavior (respect override.cfg) regardless of the run mode.

You can just not use feature tags in the override.cfg and it should work for both modes as project.godot does. This doesn't work in master, which is our use case's issue.
My issue is that in case we want to use feature tags, it will not work as project.godot do or as the documentation claims. This doesn't work after this PR too.

Both cases should work.

Documentation:

Overriding will still take the base project settings' feature tags in account. Therefore, make sure to also override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations.

That's not the case for either master or this fix.

My use case is also configuring window size and target display for different local clones, but by using feature tags I can simulate the published game settings (fullscreen, main display, etc.) when disabling embedded mode.

The reason it doesn't work currently is just that #55230 disabled loading override.cfg in the editor as it would overwrite settings in project.godot, which is also not desired.

Making the window size the only setting which ignores this behavior doesn't seems correct as well.
I think the best fix for all cases is respecting the application/config/disable_project_settings_override setting on the editor too instead of hardcoded behavior of #55230. This is a new setting.

@akien-mga
Copy link
Member Author

I see, so to be clear you want to support feature tag-based overrides defined in override.cfg, i.e. two levels of overrides? (The name/concept clashes are unfortunate.)

That make sense, if so that's probably a bit complex and might require creating a new ProjectSettings instance without messing up with the singleton (to use get_setting_with_override).

Another option for your use case (if that's the only thing you use override.cfg for) would be to set:

application/config/disable_project_settings_override = true
application/config/disable_project_settings_override.editor_hint = false

in your main project settings, so override.cfg would only be loaded by the editor for the embedded window with the changes in my PR.

@bruvzg
Copy link
Member

bruvzg commented Oct 20, 2025

That's properties to set up a window for the running project, so why would it use editor_hint feature tag? It's for the editor itself. There's embedded_in_editor which is set for embedded process, so might make sense to use it.

@bruvzg bruvzg closed this Oct 20, 2025
@bruvzg bruvzg reopened this Oct 20, 2025
@ydeltastar
Copy link
Contributor

ydeltastar commented Oct 20, 2025

Another option for your use case (if that's the only thing you use override.cfg for) would be to set:

application/config/disable_project_settings_override = true
application/config/disable_project_settings_override.editor_hint = false

in your main project settings, so override.cfg would only be loaded by the editor for the embedded window with the changes in my PR.

That makes sense. I can't do it in 4.5 though.. Didn't notice that disable_project_settings_override is a new setting in 4.6 which confused me.

That's properties to set up a window for the running project, so why would it use editor_hint feature tag? It's for the editor itself. There's embedded_in_editor which is set for embedded process, so might make sense to use it.

The embeded window is part of the editor and runs as an editor plugin. The project's window is not part of the editor when not embedded and runs as standalone. This is why the feature tag trick works in the project settings (I mean specially the embedded window in floating mode)

@akien-mga akien-mga requested a review from bruvzg October 21, 2025 20:50
@Repiteo Repiteo merged commit f946076 into godotengine:master Oct 22, 2025
60 of 61 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 22, 2025

Thanks!

@akien-mga akien-mga deleted the akien/embedded-run-respect-override branch January 16, 2026 13:08
@akien-mga
Copy link
Member Author

Cherry-picked for 4.5.2.

@akien-mga akien-mga removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EditorRun doesn't respect res://override.cfg for the embedded window placement

4 participants

X Tutup