-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: Handle unknown Action/SystemAction gracefully #68
Conversation
Seems like this doesn't work with |
Using It will be lossy for |
Seems like this doesn't work with
Other doesn't work for externally tagged enums. And the latest stable ron version (0.8) doesn't support anything but externally tagged. |
7e910ac
to
9c59924
Compare
New approach, which is working now. |
9c59924
to
8684f16
Compare
I guess we'll still need to make sure when a new default shortcut is added with a system action, cosmic-settings is updated to still be able to parse the default shortcuts. That's definitely better though. |
Yeah, thankfully cosmic-settings can be reloaded without needing to log out. |
Though that could be an issue with cosmic-comp. Which packages the default bindings, but an update will pull in the new version but not restart the compositor. |
Which will just mean that cosmic-comp will ignore the new bindings/system-action. |
What am I missing here, shouldn't cosmic-settings also simply skip over actions it doesn't know about? Or is it parsing the file separately? |
Oh, I didn't see this was also changing the de-serialization of I guess serialization isn't an issue either since |
This is an attempt to solve the issue e.g. described in #55.
New
Action
s andSystemAction
s can currently be very annoying to add, especially if they are set in the default-keybindings or system-actions ron, as older version ofcosmic-comp
orcosmic-settings
will simply refuse to launch, if they can't parse that file.This adds an
Unknown
variant to the end of the respective enums, that matches every action. This has the potential to remove those actions from user-config files by any application writing those (e.g. cosmic-settings), but imo that is reasonable and I haven't found a good way to just store and write the unserialized data in theUnknown
variant without breaking this work around one way or another.This can be merged at any time, but cosmic-settings and cosmic-comp will need updates to depend on a
cosmic-settings-config
version containing this before we can just add new variants.I plan to backport this to the cosmic-comp jammy branch as well, so we don't accidentally break that old version with new shortcuts.