Skip to content

Conversation

@bbb651
Copy link

@bbb651 bbb651 commented Feb 2, 2025

This fixes a crash with wayland-cursor and anvil, see: Smithay/smithay#1653
I'm not sure which behavior is "correct", the exact behavior seems to be undocumented but this reduces possible crashes.

(I edited action/build/dist/main.js directly because it's a single character and invoking pnpm updated the lockfile version and generated a bunch of noise)

This fixes a crash with `wayland-cursor` and `anvil`, see:
Smithay/smithay#1653
I'm not sure which behavior is "correct", this seems to be
undocumented but this reduces possible crashes.
@phisch
Copy link
Owner

phisch commented Feb 2, 2025

Would this even be necessary if this is also fixed in smithay?

It's been a while since I read up on this, but I believed that other themes set 0 in case if there is only one single frame as well.

Edit: also, I have been using this with niri, which is smithay based, for about a year now. Why does it only affect anvil?

Edit 2: lets discuss this over on the smithay repo. Nobody except me uses this cursor theme builder anyway 😛

@bbb651
Copy link
Author

bbb651 commented Feb 2, 2025

Edit: also, I have been using this with niri, which is smithay based, for about a year now. Why does it only affect anvil?

Niri has a check for it.

Would this even be necessary if this is also fixed in smithay?

Maybe? Since it's ambiguous I imagine there are more cases, it doesn't help seemingly popular cursor themes don't do that e.g. Adwaita (based on it not triggering the crash it's annoying to check since it's a binary format and their build script is weird, I hate Xcursor). On the other hand 0 feels nicer and better communicates the intent of "not animated", and it feels like it should be a tiny bit faster in e.g. niri where there's an early exit but I imagine it's within margin of error or very negligible, would be interesting to bench.

@phisch
Copy link
Owner

phisch commented Feb 2, 2025

I also dislike xcursor and existing generators. That's why I wrote an encoder for this myself: https://github.com/phisch/cursor-theme-builder/blob/master/src/lib/x11/xcursor.ts

The field used is called a delay, which is why I'm using 0 here. The field denotes the delay from the last sprite to this sprite. 0 is the only value that makes sense here imo.

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