Defer bind dispatcher validation until plugins finish loading #1
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.
Note
This is in response to hyprwm#5247 and hyprwm#4373
I chose to isolate the PR here to avoid polluting upstream pull requests with an experiment that may not be welcomed since corresponding issue/discussion were closed. Will change base branch upon request.
Problem
split:workspace) are parsed before plugins register those dispatchers.Proposal
Changes
ConfigManager.cppsrc/config/ConfigManager.cpp(handleBind)m_deferredUnknownDispatchers(vector)resetHLConfig().handlePluginLoads()inpostConfigReload, if no plugin loads are pending, surface all deferred unknown dispatchers as a single error and clear them.src/config/ConfigManager.cpp(postConfigReload),src/config/ConfigManager.hppPluginSystem.cppstd::atomic<int> m_pendingConfigPluginLoadsand accessorisLoadingConfigPlugins().src/plugins/PluginSystem.hppupdateConfigPlugins, count new plugins to load, increment the counter, decrement on completion (success/failure), and when the counter reaches zero schedule a cohesiveg_pConfigManager->reload().src/plugins/PluginSystem.cppBehavior
HyprlandAPI::addDispatcherV2.Rationale vs Alternatives
Potential Issues / Trade-offs
verifymay no longer fail purely on plugin dispatchers being absent (since plugins are not loaded in verify), which could hide plugin-related bind mistakes during verification. This could be resolved with a keyword that suppresses the deferred behavior or log-levelsTesting Notes
plugin=/path/to/plugin.soand binds to plugin dispatchers:hyprctl plugin loadstill works; subsequent reload resolves binds.Compatibility
Test Script
bash scripts/run_deferral_test.shhyprtesterplugin, runs a nested Hyprland with an isolated config, captures logs, and asserts: