snapcrafters / alacritty

A community-maintained package to easily install Alacritty on Linux
MIT License
9 stars 12 forks source link

[BUG] Mouse cursor changes theme when over the alacritty window #21

Open chasinglogic opened 7 months ago

chasinglogic commented 7 months ago

Describe the bug

My mouse cursor changes to a weird default white one when over the Alacritty window. This does not happen with other snaps installed on the system like Firefox.

To Reproduce

Steps to reproduce the behavior:

  1. Open the Alacritty snap on Ubuntu 24.04 default desktop
  2. Move the mouse cursor over the Alacritty window
  3. Observe that the cursor changes from the black with white outline default theme to an all white cursor with a different shape

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Screencast from 2024-04-30 18-03-47.webm

Environment (please complete the following information):

pedro-avalos commented 4 months ago

This is also probably related to this issue. I noticed that if I open nautilus from Alacritty, the accent color of the opened file explorer is the default one, not the one I have configured on my settings.

pedro-avalos commented 4 months ago

I'm not sure if the nautilus issue I experience is related. That may need to be a separate issue (if it is one). I think the issue with the mouse cursor has to do with the following line of the wrapper:

https://github.com/snapcrafters/alacritty/blob/45473e9b263ab3b8329306a50c50c2825e4a9df8/snap/local/custom-wrapper#L6

I think the wrapper is "undoing" what bin/desktop-launch from snapcraft-desktop-helpers does to allow snaps to match the user theme...

I see that it is being unset to allow for a user to manually set their preferred themes, but (if this is what is causing the mouse issue for normal usage) I think that is an issue to fix upstream in snapcraft-desktop-helpers. Perhaps the custom values that the desktop-launch wrapper uses should be appended (since the environment variable is a list, from my understanding).

pedro-avalos commented 4 months ago

A temporary fix, @chasinglogic (and anyone else who is bothered by this), is to set the XCURSOR_THEME variable before launching Alacritty. You can do this by using XCURSOR_THEME=Yaru alacritty (or whichever theme you are using from /usr/share/icons or ~/.local/share/icons. This is case sensitive) to launch the application. This variable is not overwritten by the wrappers. To be able to apply this change to the application when opening it through the desktop launcher / icon, you'd need to similarly edit the .desktop file's Exec=... line.

aftuw commented 4 months ago

This change breaks the cursors on my system (see https://github.com/snapcrafters/alacritty/pull/29#issuecomment-2273362056 ). Maybe this is an issue how the XCURSOR_PATH is determined by the snapcraft-desktop-helpers package? However, I don't know how to fix.

jnsgruk commented 4 months ago

@jamesh - sorry for the ping - any ideas on this one?

aftuw commented 4 months ago

It seems like this line from snapcraft-desktop-helpers is causing me issues: https://github.com/ubuntu/snapcraft-desktop-helpers/blob/master/common/desktop-exports#L77 , which sets the XCURSOR_PATH incorrectly (it should be /usr/share/icons). Additonally, before the change it also doesn't respect the chosen cursor theme, but defaults to Adawaita (which was my default, so I didn't notice before).

jnsgruk commented 4 months ago

@kenvandine is this something you're able to look at?

kenvandine commented 3 months ago

This change breaks the cursors on my system (see #29 (comment) ). Maybe this is an issue how the XCURSOR_PATH is determined by the snapcraft-desktop-helpers package? However, I don't know how to fix.

With the fix merged in #29 I can't reproduce the original issue and the cursor does seem to do the right thing for me. I'm on a pretty stock 24.04 system with the default theme. @aftuw what is your setup like?

aftuw commented 3 months ago

I am using Ubuntu 22.04 with KDE (Kubuntu).