Fix command line not being restored after NeoForge early window init#3803
Open
FlashyReese wants to merge 1 commit into
Open
Fix command line not being restored after NeoForge early window init#3803FlashyReese wants to merge 1 commit into
FlashyReese wants to merge 1 commit into
Conversation
Newer NeoForge creates the early GL context through the early window bootstrap path, so Sodium's normal Window#createGlfwWindow restore path does not run for that context. Wait for the early window renderer to initialize, then restore the Nvidia/AMD command line workaround using the existing undo methods.
Contributor
|
Thank you for looking into this. You're using a polling approach, which makes me wonder whether there's maybe instead some place that we could hook into that would give us this event explicitly. Is that possible? |
Contributor
Author
|
afaict neoforge doesn't expose a hook for this exact point. the point we want is after
so unless we add a neoforge hook or use an early transformer/mixin into neoforge internals, polling seems like the only sodium-side option. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3733
On newer NeoForge, Sodium applies the Nvidia/AMD command line workaround from the early window bootstrap path, but the normal
Window#createGlfwWindowrestore path is not hit for that early GL context.This leaves the spoofed command line in the PEB after startup.
This waits for NeoForge's early renderer to initialize, then restores the command line using the existing undo path. The workaround still stays active long enough for the driver to initialize, but it should no longer remain visible for the rest of the process.