You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
correct legacy-path bugs without breaking the public API - #406
fixes a batch of bugs on the legacy dispatch, keyword and event paths
the legacy path is being deleted upstream in #15539 but it's still what
distros on .conf configs run, so these are worth fixing properly rather
than leaving them to rot.
bug fixes:
changefloatingmode reported floating inverted. the second field is
CWindowTarget::floating(), so 1 is floating. the crate's own FIXME asked
this exact question and picked the wrong branch.
ScreencastEventData::monitor was permanently false. the field is
formatted as "monitor"/"window"/"region"/"ERR NONE", never "1", so the
== "1" check could never match.
three dispatchers hardcoded a space after the name (MoveActive,
ChangeSplitRatio, ToggleSpecialWorkspace). hyprland parses bind lines as
CVarList(value, 4), so only the dispatcher name takes a comma. a space
makes the whole string the dispatcher name and the bind gets rejected.
format_relative(0) returned a bare "+0" and dropped the monitor prefix,
so RelativeMonitor(0) read as a relative workspace.
HyprColor rejected 8 hex digit colours, which is what hyprland actually
writes. it was rejecting its own documented example. this also fixes
gradient parsing.
OptionValue had no css/gradient/font_weight arms so those came back
Unknown. all three map onto existing variants so nothing breaks.
parse_args(0) hit splitn(0, ",") and panicked. reachable on configreloaded.
WindowMoved built addresses with fmt_new, giving "0x0x55a". switched to
Address::new like the other eight parsers.
ctl::output::create sent "output create headless foo" but the syntax is
"output create headless name=foo". the old form registers an output
literally called name=foo that output remove foo can't find.
OptionValue::Bool is deliberately not here. OptionValue is a public enum
with no #[non_exhaustive], so a new variant breaks every exhaustive match
downstream. That belongs in 0.5.0 and there's a test pinning the current
behaviour so the bump is a visible change.
@romanstingler, following your plan in #391 (Lua or legacy picked at runtime from configProvider), I stacked the Lua half on top of this PR, #401 and #405, in case it saves you time when you get there:
5180299, 5751176: Lua forms for every DispatchType variant the published downstream crates use, plus a few neighbours (list in MIGRATION.md); Custom passes its text through as is. On a Lua config, the other variants return HyprError::NoLuaForm, which names the dispatcher and points to Custom.
355bfa9: Instance::config_mode() reads configProvider from j/status once per instance and caches it. On a legacy config, dispatchers get the same legacy strings as with your branch.
Tested: 47 unit tests, 6 integration tests against a fake Hyprland socket that record what each mode sends, ./test.sh passes, and end to end on Hyprland 0.57.2 with a Lua config. Not tested on a real Hyprland: the legacy path (I have no machine on hyprland.conf) and SetCursor.
One limit: on 0.56, hyprctl reload full-reset can switch the config provider while Hyprland runs, and the cache won't notice. It is documented in src/config_mode.rs.
Take whatever is useful, or none of it. I won't open a PR unless you want one.
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
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.
needs PR #401 and PR #405
fixes a batch of bugs on the legacy dispatch, keyword and event paths
the legacy path is being deleted upstream in #15539 but it's still what
distros on .conf configs run, so these are worth fixing properly rather
than leaving them to rot.
bug fixes:
changefloatingmode reported
floatinginverted. the second field isCWindowTarget::floating(), so 1 is floating. the crate's own FIXME asked
this exact question and picked the wrong branch.
ScreencastEventData::monitor was permanently false. the field is
formatted as "monitor"/"window"/"region"/"ERR NONE", never "1", so the
== "1" check could never match.
three dispatchers hardcoded a space after the name (MoveActive,
ChangeSplitRatio, ToggleSpecialWorkspace). hyprland parses bind lines as
CVarList(value, 4), so only the dispatcher name takes a comma. a space
makes the whole string the dispatcher name and the bind gets rejected.
format_relative(0) returned a bare "+0" and dropped the monitor prefix,
so RelativeMonitor(0) read as a relative workspace.
HyprColor rejected 8 hex digit colours, which is what hyprland actually
writes. it was rejecting its own documented example. this also fixes
gradient parsing.
OptionValue had no css/gradient/font_weight arms so those came back
Unknown. all three map onto existing variants so nothing breaks.
parse_args(0) hit splitn(0, ",") and panicked. reachable on configreloaded.
WindowMoved built addresses with fmt_new, giving "0x0x55a". switched to
Address::new like the other eight parsers.
ctl::output::create sent "output create headless foo" but the syntax is
"output create headless name=foo". the old form registers an output
literally called name=foo that output remove foo can't find.
OptionValue::Bool is deliberately not here. OptionValue is a public enum
with no #[non_exhaustive], so a new variant breaks every exhaustive match
downstream. That belongs in 0.5.0 and there's a test pinning the current
behaviour so the bump is a visible change.