hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.09k stars 882 forks source link

Inconsistent cursor size #6320

Closed Xygyl closed 4 months ago

Xygyl commented 4 months ago

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit cba1ade848feac44b2eda677503900639581c3f4 (props: bump version to 0.40.0). Date: Sat May 4 15:42:32 2024 Tag: v0.40.0, commits: 4606 flags: (if any) System Information: System name: Linux Node name: syn-2603-8080-3200-1fef-0000-0000-0000-168e.res6.spectrum.com Release: 6.6.30-gentoo-dist Version: #1 SMP PREEMPT_DYNAMIC Thu May 23 11:46:34 CDT 2024 GPU information: c1:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c1) (prog-if 00 [VGA controller]) os-release: NAME=Gentoo ID=gentoo PRETTY_NAME="Gentoo Linux" ANSI_COLOR="1;32" HOME_URL="https://www.gentoo.org/" SUPPORT_URL="https://www.gentoo.org/support/" BUG_REPORT_URL="https://bugs.gentoo.org/" VERSION_ID="2.15" plugins: ```

Bug or Regression?

Bug

Description

My cursor changes size when it's placed over certain parts of the Steam and Firefox UIs. It also changes size when playing any type of game (either with proton via Steam like with Minecraft).

Firefox doesn't have this issue when nwg-look is used with HYPRCURSOR_THEME and HYPRCURSOR_SIZE, though the issue persists with Steam and games.

How to reproduce

Playing any game and placing cursor over certain Steam UI parts.

Crash reports, logs, images, videos

4 3 2 1 hyprland.txt

I'm sorry for taking pictures instead of screenshots — I'm still trying to figure out grim and slurp. All pictures were taken from the same distance to demonstrate cursor size changes.

vaxerski commented 4 months ago

sad reality of cursors on linux. https://wiki.hyprland.org/Hypr-Ecosystem/hyprcursor/

play with xcursor_size until it's good enough

Xygyl commented 4 months ago

Changing xcursor_size doesn't change anything. I tried to use a different cursor, but now the cursor is distorted. Is this an issue with converting xcursors to hyprcursors? 2 1

vaxerski commented 4 months ago

converting xcursors to hyprcursors with the util works 90% of the time without issues. For best result, you should manually replace pngs with svgs. You can also use a pre-made theme, of course.

Try using hyprctl setcursor, or in your config env = XCURSOR_SIZE,24 (24 or any other size)

Xygyl commented 4 months ago

To ensure that I don't take up too much of your time and to give you the full context of the problem, here's the full scope of the issue:

I'm using phinger-cursors-dark from https://github.com/phisch/phinger-cursors. I changed it into hyprcursors via hyprcursor-util -x phinger-cursors-dark and hyprcursor-util -c extracted_phinger-cursors-dark. The hyprcursors were renamed to "phinger-cursors" and the xcursors to "phinger-cursors-X" (not just the directories, but in manifest.hl and index.theme). I placed both in ~/.icons and ~/.local/share/icons so that I can be sure that there are no discrepancies.

These lines are in my hyprland.conf:

env = HYPRCURSOR_THEME,phinger-cursors env = HYPRCURSOR_SIZE,24 env = XCURSOR_THEME,phinger-cursors-X env = XCURSOR_SIZE,24

I also have phinger-cursors-X set in nwg-look which sets it correctly for firefox.

env = XCURSOR_SIZE,24 doesn't fix the distortion nor the size issues. hyprctl setcursor phinger-cursors-X 24 sets the cursor to a small adwaita cursor. hyprctl setcursor phinger-cursors 24 has the same distortion issue.

It seems that the distortion is a problem with the xcursor to hyprcursor issue, but none of this addresses the size issue.

It's likely that I did something wrong due to this being my first venture into hyprland, though I'm not sure where that could be.

In the meantime I'm going to go through the discord and see if any of those themes work.

vaxerski commented 4 months ago

distortion is IIRC a reported issue in hyprcursor, it's a bug in the util I believe. Try some of the SVG themes from the #hyprcursor-themes channel in discord.

Xygyl commented 4 months ago

I'll try that, thank you. Is there anywhere else I can get feedback on this problem? I tried posting about it in the discord but I have yet to get a reply. I feel bad bothering the lead dev with such a mundane problem.

Xygyl commented 4 months ago

This problem just keeps getting more complicated. I set my theme to https://github.com/ndom91/rose-pine-hyprcursor and now hyprpaper doesn't work. My cursor is now different for my desktop, firefox, and steam. The small cursor and big cursor on steam have different themes (in a different permutation than before, but that's unneeded context). I think the actual solution is to not use hyprland since nothing seems to solve this problem. Unless you have any ideas or anyone else I can talk to about this, I think that I'm just going to try a different wm.

vaxerski commented 4 months ago

you can also not use hyprcursor. I feel like this is a misconfiguration of some sort on your end though as it seems to work just fine for me and many others

Xygyl commented 4 months ago

It is. The frustration comes from not knowing what is misconfigured. I'm looking through everything and can't find anything out of place. Like why would changing my cursor make hyprpaper not work?

Xygyl commented 4 months ago

I just tried using just xcursor without making any changes to anything else, but it's distorted, which makes me think that the original distortion isn't because of hyprcursor-util. At this point I'm just confused, and the lack of help (not referring to you) or documentation is making this increasingly frustrating.

nktnet1 commented 3 months ago

I had a similar issue as this Reddit post here, whereby the

cursor size smaller on desktop than everywhere else

A related issue might be "Cursor size with HiDPi #2448"


The most consistent way I've managed to get the cursors working is to install a cursor theme that has both Xcursor and Hyprcursor variants, then set their sizes using nwg-look and in hyprland environment variables respectively.

For example, using rose-pine cursor on Arch and assuming you have the AUR helper yay, here are the steps:

  1. Install rose-pine/cursor from the AUR:

    yay -S rose-pine-cursor
  2. Install rose-pine-hyprcursor from the AUR:

    yay -S rose-pine-hyprcursor
  3. Install nwg-look:

    yay -S nwg-look
  4. Open nwg-look and set your preferred Xcursor and size:

    nwg-look-settings

  5. Open your ~/.config/hypr/hyprland.conf and use the same configuration for Hyprcursor:

    exec-once = gsettings set org.gnome.desktop.interface cursor-theme BreezeX-RosePine-Linux
    exec-once = gsettings set org.gnome.desktop.interface cursor-size 28
    
    env = HYPRCURSOR_SIZE,28
    env = HYPRCURSOR_THEME,rose-pine-hyprcursor
  6. Restart Hyprland or reboot your device

The cursors should now match when moving from your wallpaper to an application, e.g. firefox.

For more hyprcursor themes, take a look at the #hyprcursor-themes channel on Hyprland's discord:

HK-Sepuri commented 2 months ago

https://github.com/hyprwm/Hyprland/issues/6320#issuecomment-2243109637

This worked !!, so i need to find xcursor theme of same hyprcursor theme got it ! Thank you :)

xdevs23 commented 2 months ago

The most consistent way I've managed to get the cursors working is to install a cursor theme that has both Xcursor and Hyprcursor variants, then set their sizes using nwg-look and in hyprland environment variables respectively.

Finally a solution for this that has been haunting me ever since.