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

Automatically reload mouse cursor theme when theme config changes #232

Open
Hubro opened this issue Apr 7, 2022 · 7 comments
Open

Automatically reload mouse cursor theme when theme config changes #232

Hubro opened this issue Apr 7, 2022 · 7 comments

Comments

@Hubro
Copy link

Hubro commented Apr 7, 2022

Applications that use client-toolkit (such as Neovide and Alacritty) get the correct mouse cursor based on my current icon theme.

However, if I change the mouse cursor theme by editing $HOME/.icons/default/index.theme from, for example:

[icon theme]
Inherits=Adwaita

To:

[icon theme]
Inherits=Breeze_Snow

I have to restart the application for the change to take effect. This makes it extremely inconvenient to test out various mouse cursor themes and it makes it impossible to automate switching mouse cursor themes to comply with the system wide light/dark theme preference.

It would be amazing if client-toolkit could watch the current theme and reload the graphics if the theme changes.

@Hubro
Copy link
Author

Hubro commented Apr 7, 2022

Alternatively, if this could be achieved more easily by disabling caching of the mouse cursor theme, perhaps through an environment variable, that would be acceptable to me.

@elinorbgr
Copy link
Member

However, if I change the mouse cursor theme by editing $HOME/.icons/default/index.theme

Do you have examples of apps that react to this? That seems like requesting SCTK to randomly watch a bunch of files for modifications, which does not seem like something we actually would want to do.

@Hubro
Copy link
Author

Hubro commented Apr 27, 2022

@vberger When I change my cursor theme, all Gnome applications pick it up immediately (nautilus, gnome-calculator, gnome-terminal etc.), in fact all GTK applications appear to pick it up immediately (tested solaar and waybar) and all my browsers pick it up immediately (tested Vivaldi, Chrome, Chromium, Firefox).

These applications all seem to pick up the cursor theme from gsettings though.

That seems like requesting SCTK to randomly watch a bunch of files for modifications, which does not seem like something we actually would want to do.

That does indeed sound overkill for something like this, but surely there must be other ways of picking up the change. What about reloading the cursor scheme any time the window gains focus or something like that?

Loading the cursor icons once and never letting them change just seems like the opposite extreme to me, and it blocks use cases such as globally changing color schemes.

@elinorbgr
Copy link
Member

What about reloading the cursor scheme any time the window gains focus or something like that?

Given the current level of abstraction that SCTK is, that would rather be "provide a method for reloading the cursor theme that the downstream app invokes when it sees fit". I guess that could work.

@Hubro
Copy link
Author

Hubro commented Apr 28, 2022

I think ideally SCTK would handle low-level "boring" things like this without application developers having to think about it, but if there's no graceful and sensible way to do that, providing a simple function for it would at least be a big improvement.

@elinorbgr
Copy link
Member

I think ideally SCTK would handle low-level "boring" things like this without application developers having to think about it

The API exposed by SCTK is currently not high-level enough to do that. But that would be easily done in winit (which alacritty uses).

@Hubro
Copy link
Author

Hubro commented Apr 28, 2022

Right, that makes sense. Is the pointer "ThemeManager" a long-lived object? Would it make sense to add a reload function to it?

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