Skip to content

Fix crash when opening ShaderEditorDock with a VisualShader open - #124245

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
GabCoolDude:fix-shadereditor-visualshader-crash
Oct 8, 2026
Merged

Repiteo merged 1 commit into
godotengine:masterfrom
GabCoolDude:fix-shadereditor-visualshader-crash

Conversation

@GabCoolDude

@GabCoolDude GabCoolDude commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

@kitbdev kitbdev left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixes the crash.
But this causes it to get a focus outline when switching to it. I think the VisualShaderEditor shouldn't be taking focus here at all, so DocumentEditorContainer::focus_active_editor() should check if seb->get_base_editor() is null instead. Or check if its TextEditorBase instead of ScriptEditorBase.

If wanted, this can be merged as is to fix the crash, and the focus issue can be addressed after.

@GabCoolDude
GabCoolDude force-pushed the fix-shadereditor-visualshader-crash branch from 05122bc to a6a521b Compare October 8, 2026 06:17
@GabCoolDude
GabCoolDude requested a review from a team as a code owner October 8, 2026 06:17
@GabCoolDude

Copy link
Copy Markdown
Contributor Author

so DocumentEditorContainer::focus_active_editor() should check if seb->get_base_editor() is null instead

This is the approach I went ahead with, the focus outline was bugging me too.

@kitbdev kitbdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, fixes the issue.

@Repiteo
Repiteo merged commit f30d9af into godotengine:master Oct 8, 2026
20 checks passed
@Repiteo

Repiteo commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thanks!

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.

Crash when opening ShaderEditor dock with a VisualShader open

4 participants