Skip to content
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

Does not use Xcursor.theme from resource database as fallback #24

Closed
psychon opened this issue Aug 15, 2024 · 2 comments
Closed

Does not use Xcursor.theme from resource database as fallback #24

psychon opened this issue Aug 15, 2024 · 2 comments

Comments

@psychon
Copy link
Contributor

psychon commented Aug 15, 2024

Hi there,

I just got a PR about the cursor implementation in x11rb: psychon/x11rb#936

Due to that, I looked at what libXcursor is doing and found a difference to your crate. libXcursor falls back to using Xcursor.theme from the X11 resource database if $XCURSOR_THEME is not set. xcursor-rs instead seems to fall back to XDG data directory if the env var is missing.

No idea what to do about this. Your crate does not have an X11 connection and does not have access to the X11 resource database. So, the only idea that would come to my mind would be turn this into the caller's problem: Add a new function that needs to pass in e.g. an Option<&str> containing the value of Xcursor.theme.

(x11rb also does not implement this fallback and neither does libxcb-cursor, which was used as the inspiration for x11rb's implementation)

@esposm03
Copy link
Owner

I'm actually not too familiar with that X11 resource, but isn't that just a way to specify a cursor theme name, not to override where it is searched for? If you look at the libXcursor source, it looks for that resource if the variable XCURSOR_THEME is not specified, while the only envvar this crate reads is XCURSOR_PATH.

I think you should just be able to call CursorTheme::load with the appropriate name, and on your side implement the logic to read the Xresource, if necessary.

@psychon
Copy link
Contributor Author

psychon commented Aug 15, 2024

I'm actually not too familiar with that X11 resource,

No worries. No one is. :-)

a way to specify a cursor theme name, not to override where it is searched for

Whoops. Sorry for the noise. Apparently I cannot read. 🙈

You are right that I mixed something up here. Figuring out the name of the active cursor theme is not part of this crate anyway.

@psychon psychon closed this as completed Aug 15, 2024
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

No branches or pull requests

2 participants