Skip to content

wayfire-shell: Allow clients to use < version 3 without crashing#3054

Open
soreau wants to merge 3 commits into
masterfrom
fix-wf-shell-crash
Open

wayfire-shell: Allow clients to use < version 3 without crashing#3054
soreau wants to merge 3 commits into
masterfrom
fix-wf-shell-crash

Conversation

@soreau

@soreau soreau commented Jun 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@ammen99 ammen99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch! Two things:

  • I see no reason to pass and store the full resource, it would be enough to have the uint32_t client_version
  • All checks should be in the min(client_version, 3) format, hardcoding between 1 and 3 simply means we'd have to change all of this again if we ever upgrade the protocol in the future. Even better: define the current version as a constant in the beginning of the file (static constexpr uint32_t WAYFIRE_SHELL_VERSION = 3; and then use that everywhere :)

@soreau

soreau commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

Nice catch! Two things:

  • I see no reason to pass and store the full resource, it would be enough to have the uint32_t client_version

Yes I considered this but decided to follow surrounding convention, which is less churn.

  • All checks should be in the min(client_version, 3) format, hardcoding between 1 and 3 simply means we'd have to change all of this again if we ever upgrade the protocol in the future. Even better: define the current version as a constant in the beginning of the file (static constexpr uint32_t WAYFIRE_SHELL_VERSION = 3; and then use that everywhere :)

I believe this information is already in the protocol headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants