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

GTK cursor sets to default after suspend #9441

Open
3 of 6 tasks
kRHYME7 opened this issue Feb 19, 2025 · 20 comments
Open
3 of 6 tasks

GTK cursor sets to default after suspend #9441

kRHYME7 opened this issue Feb 19, 2025 · 20 comments
Labels
bug Something isn't working

Comments

@kRHYME7
Copy link

kRHYME7 commented Feb 19, 2025

Already reported ? *

  • I have searched the existing open and closed issues.

Regression?

Not a regression - it's an old bug, Probably not a regression / I don't remember it happening before

System Info and Hyprland Version

System/Version info
Hyprland 0.47.0 built from branch main at commit 3352317ca827dfb2dfd222274dfaf5941c78c086  (scripts/generateVersion.sh: convert to posix (9433)).
Date: Tue Feb 18 14:18:22 2025
Tag: v0.47.0-86-g3352317c, commits: 5828
built against:
 aquamarine 0.7.2
 hyprlang 0.6.0
 hyprutils 0.5.0
 hyprcursor 0.1.11
 hyprgraphics 0.1.2


no flags were set


System Information:
System name: Linux
Node name: archlinux
Release: 6.12.15-1-lts
Version: #1 SMP PREEMPT_DYNAMIC Tue, 18 Feb 2025 09:31:25 +0000


GPU information: 
00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-U GT2 [UHD Graphics] [8086:9b41] (rev 02) (prog-if 00 [VGA controller])
01:00.0 3D controller [0302]: NVIDIA Corporation GP108BM [GeForce MX250] [10de:1d52] (rev a1)
NVRM version: NVIDIA UNIX x86_64 Kernel Module  570.86.16  Fri Jan 24 21:25:51 UTC 2025


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:
  hyprbars by Vaxry ver 1.0



Description

So this 5-month-old thread sums it up https://www.reddit.com/r/hyprland/comments/1fcpt30/gtk_cursor_theme_keeps_resetting/

How to reproduce

Hyprland sets my gtk cursor to default.

❯ hyprctl getoption cursor:sync_gsettings_theme
int: 1
set: false
❯ gsettings get org.gnome.desktop.interface cursor-theme
'Bibata-Modern-Ice'
❯ dconf dump / | grep cursor-theme
cursor-theme='Bibata-Modern-Ice'
❯ systemctl suspend
❯ dconf dump / | grep cursor-theme
cursor-theme='default'
❯ gsettings get org.gnome.desktop.interface cursor-theme
'default'
❯ hyprctl getoption cursor:sync_gsettings_theme
int: 1
set: false

I cannot replicate this on TTY.

Attach not paste

  • I understand that all text files must be attached, and not pasted directly. If not respected, this issue will likely get closed as spam

Checklist of files to include below

  • Hyprland config - hyprctl systeminfo -c (always include)
  • Crash report (always include in case of crash)
  • Video (always include in case of a visual bug)
  • Logs (might contain useful info such as errors)

Additional info & File uploads

hyprland_config_dump.txt


I tried this Reddit comment using gnome tweaks, but it's no use. Also, I always run dconf reset -f / on our theme change, therefore It probably simulates the reset i gnome tweak.

And also toggling cursor:sync_gsettings_theme to true/false doesn't do anything.

@kRHYME7 kRHYME7 added the bug Something isn't working label Feb 19, 2025
@nnyyxxxx
Copy link
Contributor

cant repro this

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 20, 2025

Across reboots are fine for me as we had exec to execute the dconf commands for gtk stuff. As for resume from suspend/hibernation I think the compositor changes cursor to 'default'.

@nnyyxxxx
Copy link
Contributor

the only thing i could find was this:

setValue("cursor-theme", themeName, "org.gnome.desktop.interface");

setValue("cursor-size", unscaledSize, "org.gnome.desktop.interface");

it's related to:

sync_gsettings_theme

hyprland doesn't read from gsettings its only writing to it, something else is affecting the cursor theme.
so in turn, hyprland is not the cause here.

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 20, 2025

Uhm I think it's still hyprland. It's hard to scroll code on my phone but will you also please check the method to get the themeName? My theory is it returns 'default' when empty.

@nnyyxxxx
Copy link
Contributor

actually i was wrong a bit..

but still though, default is only set as the last resort . way too many conditionals for me to count

@nnyyxxxx
Copy link
Contributor

so when hyprcursor is enabled:

first it tries to use whatever theme name u gave it
if u didnt give it a name or hyprcursor fails loading:
checks if XCURSOR_THEME env var exists and uses that
if that doesnt exist either it just uses "default"

So, if XCURSOR_THEME is set then: default, should never be used even if hyprcursor fails

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 20, 2025

I will try to repro this on an isolated env and will let you know.

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 20, 2025

checks if XCURSOR_THEME env var exists and uses that

I see, this holds true when XCURSOR is set. I think you can repro now if you comment out any env = XCURSOR_THEME, ... declarations. I am trying to avoid setting env as much as possible to make it dynamic. As setting env vars make the majority of the application to stick to it across sessions.

How about instead of XCURSOR env we use dconf to access the database?
if xcursor is empty see if dconf read /org/gnome/desktop/interface/cursor-theme returns something.

Image

@nnyyxxxx
Copy link
Contributor

idk up to @vaxerski but hes lazy

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 20, 2025

Are there any method to query /org/gnome/desktop/interface/cursor-theme without calling external stuff? I'm noob.

@nnyyxxxx
Copy link
Contributor

idk the codebase is so large ive only recently started committing to it

@vaxerski
Copy link
Member

looks like a dbus interface. We don't interact with dbus in hl at all. Besides, that's a gnome interface.

@nnyyxxxx
Copy link
Contributor

maybe we need a new fallback before we set default, any ideas @vaxerski

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 23, 2025

And also toggling the cursor:sync_settings_theme to true/false doesn't do anything.

Do setting this to false prevent Hyprland to modify the gsettings' cursor theme?

@gulafaran
Copy link
Contributor

And also toggling the cursor:sync_settings_theme to true/false doesn't do anything.

Do setting this to false prevent Hyprland to modify the gsettings' cursor theme?

yes

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 23, 2025

yes

So, uhm, this is a bug?

Image

@gulafaran
Copy link
Contributor

yes

So, uhm, this is a bug?

Image

i would more of say its intended, not entirerly familiar with how suspend works but gsettings is not permanent. so you probably have it set, suspend, and wakeup and its "reset" and unless something sets it again it will just become "default". so the bug might more be that sync_gsettings perhaps should sync again once you wake up from suspend

@kRHYME7
Copy link
Author

kRHYME7 commented Feb 23, 2025

gsettings is not permanent.

Nope, it can be saved in a dconf database. But if I understand correctly, hyprland queries from dbus which works perfectly fine as long as it's active. But in situations like on resume from suspend, maybe dbus is not yet available when hyprland sets the xcursor/GTK cursor.

Also resetting the database returns '' (null) not "default"

Note that I cannot replicate this on TTY. And only happens when hyprland returns from suspend.


For environments that implement their own cursor theming scripts, I am expecting for cursor:sync_gsettings_theme to not touch the gsettings if the var is false.

If cursor:sync_gsettings_theme is false, I am expecting that dbus or whatever reads the values from the dconf database, sets the cursor-theme correctly.


Or am I misinterpreting this var?

@gulafaran
Copy link
Contributor

@ikalco broke this 39df1f4

@gulafaran
Copy link
Contributor

@ikalco broke this 39df1f4

So yes its bugged, syncs no matter the setting on session "change"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants