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
19.73k stars 837 forks source link

Cursor size not applying #5183

Closed flippette closed 6 months ago

flippette commented 6 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit c5e28ebcfe00a510922779b2c568cfa52a317445 (props: bump ver 0.37.1). Date: Sat Mar 16 14:51:49 2024 Tag: v0.37.1 flags: (if any) System Information: System name: Linux Node name: okinawa Release: 6.8.1-zen1-1-zen Version: #1 ZEN SMP PREEMPT_DYNAMIC Sat, 16 Mar 2024 17:15:23 +0000 GPU information: 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 32 [Radeon RX 7700 XT / 7800 XT] [1002:747e] (rev c8) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```

Bug or Regression?

Regression

Description

The cursor size on the desktop and non-GTK apps (I've tested foot and kdenlive) does not respect the size set in nwg-look, with or without the XCURSOR_SIZE environment variable.

How to reproduce

My config file is located here.

Contents for idempotence:

# color theme
source = ~/.config/hypr/mocha.conf

# environment variables
env = XCURSOR_SIZE,40
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = WLR_DRM_NO_ATOMIC,1
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_QPA_PLATFORMTHEME,qt5ct

# key definitions
$mod = SUPER
$left = H
$right = L
$up = K
$down = J

# app preferences
$term = foot
$menu = bemenu-run

# general configuration
general {
    allow_tearing = true
    col.active_border = $mauve
    border_size = 2
    gaps_in = 3
    gaps_out = 6
}

# decoration configuration
decoration {
    rounding = 4
}

# misc configuration
misc {
    disable_hyprland_logo = true
    mouse_move_enables_dpms = true
    no_direct_scanout = false
}

# monitor configuration
monitor=DP-2,1920x1080@144,auto,1

# input configuration
input {
    sensitivity = 0.0
    accel_profile = flat
    mouse_refocus = false
}

dwindle {
    preserve_split = true
}

# key bindings
    bind = $mod, Return, exec, $term                         # start terminal
    bind = $mod Shift, Q, killactive                         # kill focused window
    bind = $mod, D, exec, $menu                              # start launcher
    bindm = $mod, mouse:272, movewindow                      # move focused floating window
    bindm = $mod, mouse:273, resizewindow                    # resize current window
    bind = $mod Alt_L Ctrl_L, L, exec, hyprctl dispatch dpms # turn off monitor
    bind = $mod Alt_L Ctrl_L Shift, E, exit                  # exit hyprland

    # bind volume control to XF86Audio{Raise,Lower}Volume
    bind = ,122, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
    bind = ,123, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+

    # move focus
    bind = $mod, $left, movefocus, l
    bind = $mod, $right, movefocus, r
    bind = $mod, $up, movefocus, u
    bind = $mod, $down, movefocus, d

    # move focused window
    bind = $mod Shift, $left, movewindow, l
    bind = $mod Shift, $right, movewindow, r
    bind = $mod Shift, $up, movewindow, u
    bind = $mod Shift, $down, movewindow, d

    # switch workspaces
    bind = $mod, 1, workspace, 1
    bind = $mod, 2, workspace, 2
    bind = $mod, 3, workspace, 3
    bind = $mod, 4, workspace, 4
    bind = $mod, 5, workspace, 5
    bind = $mod, 6, workspace, 6
    bind = $mod, 7, workspace, 7
    bind = $mod, 8, workspace, 8
    bind = $mod, 9, workspace, 9
    bind = $mod, 0, workspace, 10

    # move focused window to workspace
    bind = $mod Shift, 1, movetoworkspacesilent, 1
    bind = $mod Shift, 2, movetoworkspacesilent, 2
    bind = $mod Shift, 3, movetoworkspacesilent, 3
    bind = $mod Shift, 4, movetoworkspacesilent, 4
    bind = $mod Shift, 5, movetoworkspacesilent, 5
    bind = $mod Shift, 6, movetoworkspacesilent, 6
    bind = $mod Shift, 7, movetoworkspacesilent, 7
    bind = $mod Shift, 8, movetoworkspacesilent, 8
    bind = $mod Shift, 9, movetoworkspacesilent, 9
    bind = $mod Shift, 0, movetoworkspacesilent, 10

    # make focused window fullscreen
    bind = $mod, F, fullscreen

    # toggle focused window floating
    bind = $mod Shift, Space, togglefloating

    # screenshot
    bind = $mod Shift, P, exec, grimshot save anything
    bind = $mod, P, exec, grimshot copy anything
    bind = $mod Ctrl_L Shift_L, P, exec, grimshot save active
    bind = $mod Ctrl_L, P, exec, grimshot copy active

    # color picker
    bind = $mod, C, exec, hyprpicker -a

    # screen locking
    bind = $mod Ctrl_L, L, exec, waylock -init-color 0x1E1E2E -input-color 0x181825 -fail-color 0xEF8BA8

# animation configuration
animations {
    enabled = true
}
bezier = ease_inout_sine, 0.37, 0, 0.63, 1
animation = global, 1, 1.5, ease_inout_sine

# window rules
    windowrulev2 = immediate, class:^(ADanceOfFireAndIce)$ # ADOFAI
    windowrulev2 = immediate, class:^(steam_app_1144200)$  # Ready Or Not
    windowrulev2 = immediate, class:^(q2rtx)$ # Quake II RTX
    windowrulev2 = immediate, class:^(cs2)$ # Counter-Strike 2
    windowrulev2 = immediate, class:^(steam_proton)$ # some proton game
    windowrulev2 = immediate, class:^(gamescope)$ # gamescope

    windowrulev2 = float, class:^(file-[a-z]+)$, title:^(Export Image as [A-Z, ,a-z]+)$ # GIMP image export dialog
    windowrulev2 = float, class:^(steam)$, title:^(Steam Settings)$ # Steam settings dialog
    windowrulev2 = float, class:^(org.qbittorrent.qBittorrent)$, title:^(?!qBittorrent).*$ # qBittorrent dialogs
    windowrulev2 = float, class:^(Menci)$ # ADOFAI file dialogs
    windowrulev2 = float, class:^(org.kde.kdenlive)$, title:^(Kdenlive)$ # Kdenlive splash screen
    windowrulev2 = float, class:^(horizon-eda)$, title:^(Part Browser)$ # horizon-eda part browser
    windowrulev2 = float, class:^(net.davidotek.pupgui2)$, title:^(ProtonUp-Qt) # protonup-qt
    windowrulev2 = float, class:^(blender)$, title:^(Blender Preferences)$ # Blender preferences
    windowrulev2 = float, class:^(org.kde.okular)$, title:^(New Text Note) # Okular New Text Node

# execs
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment QT_QPA_PLATFORMTHEME
exec-once = waybar
exec-once = hyprpaper
exec-once = dunst
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = udiskie -t --appindicator
exec-once = dex --autostart --environment hyprland
exec-once = hyprctl setcursor BreezeX-Black 40

Crash reports, logs, images, videos

https://github.com/hyprwm/Hyprland/assets/43138244/7910dc85-dba5-404b-bb73-9bcd38b613ae

M4he commented 6 months ago

Your cursor theme (BreezeX) does not seem to support the specified size of 40:

https://github.com/ful1e5/BreezeX_Cursor?tab=readme-ov-file#cursor-sizes

I've experienced the same with another theme before. While GTK seems to be able to scale it to fit sizes not provided by the theme, Qt cannot. Try setting a size that is listed in the link above for your hyprctl setcursor and XCURSOR_SIZE settings.

flippette commented 6 months ago

It... literally lists 40 in the supported list?

IMG_20240320_233341.jpg

Also it did work previously so that can't have been an issue with the cursor theme right?

M4he commented 6 months ago

It... literally lists 40

Oops. I'm sorry, you are right. This size is listed, I must've been blind.

M4he commented 6 months ago

If it worked for you before maybe it was before the introduction of Hyprcursor?

Hyprcursor seems to be on by default now. Have you tried turning it off?

misc {
    ...
    enable_hyprcursor = false
}

See https://wiki.hyprland.org/Configuring/Variables/#misc

M4he commented 6 months ago

... adding to the above, there seem to be new settings for that feature:

env = HYPRCURSOR_THEME,MyCursor
env = HYPRCURSOR_SIZE,24

See https://wiki.hyprland.org/Hypr-Ecosystem/hyprcursor/#hyprcursor-themes

M4he commented 6 months ago

You seeing correct cursor sizes in GTK only in conjunction with hyprcursor could be because of this:

[...] QT, chromium, electron and hypr* apps support cursor_shape, so in hyprland (or any other compositor using hyprcursors) you will get your pixel-perfect hyprcursors.

Notably, GTK does not support the protocol, so apps like firefox, or the entire gnome suite will fall back to the ugly XCursor themes.

Source: https://blog.vaxry.net/articles/2024-cursors

flippette commented 6 months ago

I've switched to Bibata-Modern-Classic (with both the hyprcursor theme on the Discord server & the bibata-cursor-theme Arch package), with the following config changes:

# <...irrelevant...>
env = HYPRCURSOR_THEME,Bibata-Modern-Classic
env = HYPRCURSOR_SIZE,32
env = XCURSOR_THEME,Bibata-Modern-Classic
env = XCURSOR_SIZE,32
# <...irrelevant...>

However, the cursor now straight up disappears until it enters a GTK app, and then it does not change in any app not using GTK.

You can see that behavior here:

https://github.com/hyprwm/Hyprland/assets/43138244/c9a1be07-1baa-44ab-be5a-1a05ea85f156

vaxerski commented 6 months ago

if it's the hyprcursor theme from the discord server the name of it is HyprBibataModernClassicSVG.

flippette commented 6 months ago

if it's the hyprcursor theme from the discord server the name of it is HyprBibataModernClassicSVG.

manifest.hl says Bibata-Modern-Classic though?

Also I tried repackaging BreezeX and that didn't work either.

vaxerski commented 6 months ago

image

flippette commented 6 months ago

image

The theme is located at ~/.local/share/icons/Bibata-Modern-Classic, FWIW.

flippette commented 6 months ago

I'm back on the computer now, here's the theme:

~ ❯ ll ~/.local/share/icons
drwxr-xr-x - flippette 19 Mar 04:35  Bibata-Modern-Classic
drwxr-xr-x - flippette 13 Feb 01:34  default
drwxr-xr-x - flippette 21 Mar 00:19  hicolor
~ ❯ head ~/.local/share/icons/Bibata-Modern-Classic/manifest.hl -n 1
name = Bibata-Modern-Classic
vaxerski commented 6 months ago

what if you manually run hyprctl setcursor with your hyprcursor theme? hyprctl setcursor Bibata-Modern-Classic 32

flippette commented 6 months ago

Same behaviour occurs with manually running hyprctl setcursor Bibata-Modern-Classic 32.

vaxerski commented 6 months ago

idk sounds like a faulty theme.

MrYuto commented 6 months ago

I think there is a regression in the new update cause the hyprctl setcursor does not set any new cursor and fallback on the old one that is cached or something. I added the env variables and at the new startup my cursor theme is updated:

env = HYPRCURSOR_THEME,Bibata-Modern-Classic
env = HYPRCURSOR_SIZE,20
env = XCURSOR_THEME,Bibata-Modern-Classic
env = XCURSOR_SIZE,20
flippette commented 6 months ago

I think there is a regression in the new update cause the hyprctl setcursor does not set any new cursor and fallback on the old one that is cached or something. I added the env variables and at the new startup my cursor theme is updated:

env = HYPRCURSOR_THEME,Bibata-Modern-Classic
env = HYPRCURSOR_SIZE,20
env = XCURSOR_THEME,Bibata-Modern-Classic
env = XCURSOR_SIZE,20

I fail to see the difference between this and my other comment?

# <...irrelevant...>
env = HYPRCURSOR_THEME,Bibata-Modern-Classic
env = HYPRCURSOR_SIZE,32
env = XCURSOR_THEME,Bibata-Modern-Classic
env = XCURSOR_SIZE,32
# <...irrelevant...>
flippette commented 6 months ago

So turns out the hyprcursor theme... wasn't compiled :facepalm: My bad.

vaxerski commented 6 months ago

not reading the readme moment