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

mpv 0.31 does not respect cursor theme on Gnome Wayland session #7307

Closed
glaubersm opened this issue Dec 30, 2019 · 46 comments
Closed

mpv 0.31 does not respect cursor theme on Gnome Wayland session #7307

glaubersm opened this issue Dec 30, 2019 · 46 comments

Comments

@glaubersm
Copy link

mpv version and platform

mpv 0.31, linux

Reproduction steps

open mpv on a linux distribution running Gnome Wayland session.
The bug does not occur on X11 session.

Expected behavior

mpv respects the cursor theme when we hover over it.

Actual behavior

cursor theme changes from Adwaita to Breeze when I hover over mpv on my system.

Log file

output.txt

@ghost
Copy link

ghost commented Dec 30, 2019

This happens because X11 is the better platform.

@glaubersm
Copy link
Author

mpv is the only app with this bug on my system.

@ghost ghost closed this as completed in a6d8e9b Dec 30, 2019
@Dudemanguy
Copy link
Member

Dudemanguy commented Dec 30, 2019

Last time I checked, it's because GNOME wants everyone to use dbus (lol) to set cursor themes which obviously isn't going to happen here. Currently, mpv reads an environment variable which isn't ideal (why isn't this a protocol yet), but it's not nearly as dumb.

@CounterPillow
Copy link
Contributor

Even if there was a wayland protocol for this, GNOME wouldn't implement this. But it's not a bad idea to make it a protocol.

The problem with environment variables is that changes don't apply until an application is restarted. Can we get KDE and Sway on board to write us a non-dbus wayland protocol spec and implementations for requesting current cursor style and signalling changes in cursor style? I know we have @ddevault as an mpv user, surely someone involved with KDE uses mpv too.

@ddevault
Copy link
Contributor

We've discussed writing a cursor theme protocol extension in the past. It's a bit of a complex issue. For one, Sway doesn't care what your cursor theme is, and it kind of lets you configure it, but not really. lxappearance et al will configure the GTK+ theme, but that's independent of Qt apps or anyone like mpv who rolls their own thing. In other words, even outside of Wayland there really isn't a consistent standard to begin with, so we'd be trodding on completely fresh ground and working uphill to adopt something across the ecosystem.

I have been working on some stuff on the side which could potentially unify these things under one standard, alongside icon themes, font preferences, and so on, but it would live independently of Wayland, since your theme preferences have little to do with your display system.

No timeframe on that, though.

@ghost
Copy link

ghost commented Dec 30, 2019

I have been working on some stuff on the side which could potentially unify these things under one standard, alongside icon themes, font preferences, and so on, but it would live independently of Wayland, since your theme preferences have little to do with your display system.

So using dbus?

@ddevault
Copy link
Contributor

No, just config files on disk.

@Dudemanguy
Copy link
Member

Dudemanguy commented Dec 30, 2019

Currently, mpv reads an environment variable

A correction to what I said above. Cursor size is the environment variable that's read (different but related problem). The cursor theme comes from wl_cursor_theme_load. Just a guess here, but I think GNOME probably only uses gsettings to change the cursor theme which only works with gtk applications.

You need to make/edit a ~/.icons/default/index.theme to actually change the cursor theme globally which everyone except GNOME probably respects. It seems like GNOME uses ~/.config/gtk-3.0/settings.ini for whatever special snowflake reason. I just remembered that I have a few gsettings lines in my sway config probably for exactly this reason.

@emersion
Copy link
Contributor

The problem with environment variables is that changes don't apply until an application is restarted. Can we get KDE and Sway on board to write us a non-dbus wayland protocol spec and implementations for requesting current cursor style and signalling changes in cursor style? I know we have @ddevault as an mpv user, surely someone involved with KDE uses mpv too.

https://lists.freedesktop.org/archives/wayland-devel/2018-December/039752.html

@glaubersm
Copy link
Author

Tthis bug persists with mpv 0.32.

@Dudemanguy
Copy link
Member

Dudemanguy commented Jan 27, 2020

Did you try setting a cursor theme in ~/.icons/default/index.theme (lxappearance sets it there I think)? That's what mpv reads.

@ghost
Copy link

ghost commented Jan 27, 2020

A D-Bus API... motherfucking idiots. Screw Wayland, which I will from now on call Shitland.

@ddevault
Copy link
Contributor

mplayer sucks, therefore mpv sucks. more like shitpv amirite

@ghost
Copy link

ghost commented Jan 27, 2020

The real intentions of the Shitland devs surface. Enjoy your fucked up d-bus rube goldberg contraption where nothing works unless it's gnome, in which case it sort of works but not really.
X11 is so much better.

@glaubersm
Copy link
Author

I used lxappearance to set cursor, now mpv shows the right cursor.
But thas's not correct. mpv should use Gnome settings.

@emersion
Copy link
Contributor

But thas's not correct. mpv should use Gnome settings.

No. Applications shouldn't have to poke at compositor-specific files/interfaces.

@CounterPillow
Copy link
Contributor

CounterPillow commented Jan 27, 2020

But thas's not correct. mpv should use Gnome settings.

No it shouldn't.

Thank you emersion for writing the required protocol.

@glaubersm
Copy link
Author

mpv is the only app that requires additional step to use the cursor theme configured in Gnome settings. That's ridiculous, that's not correct.

@ddevault
Copy link
Contributor

Gnome is the only desktop which demands special treatment.

@glaubersm
Copy link
Author

why do all other apps use the cursor theme configured in Gnome settings
without any additional step?

@ddevault
Copy link
Contributor

Because they capitulate to Gnome's unreasonable demands.

@glaubersm
Copy link
Author

define "Gnome's unreasonable demands".

@ghost
Copy link

ghost commented Jan 27, 2020

@glaubersm is of course correct, gnome being a major Linux desktop, I can only blame the unreasonable pile of shit of a standard behind it.

@ghost ghost reopened this Jan 27, 2020
@Dudemanguy
Copy link
Member

mpv uses wl_cursor_theme_load which is a standard, wayland function. It's not our fault if GNOME doesn't support this.

@emersion
Copy link
Contributor

@glaubersm: imagine a world where each and every application needs to add explicit support to each and every compositor. That's what I'd call "unreasonable".

@glaubersm
Copy link
Author

is there any Wayland compositor supporting cursor protocol currently?

@ghost
Copy link

ghost commented Jan 27, 2020

@emersion that xdg d-bus poop is a desktop-spanning standard though.
Also, gnome sets the defacto standard here, even if @ddevault doesn't want to believe it.

@CounterPillow
Copy link
Contributor

@emersion please, the obvious solution is to make GNOME the only software on the planet, no need for standards then :^)

@ddevault
Copy link
Contributor

Are we really going to have yet another argument about Wayland in which we repeat the same stupid bullshit we've said in every other argument about Wayland? Just give it up. Wayland users are perfectly satisfied with mpv's wayland support and Gnome users are idiots. We already agreed that you should just close gnome tickets and move on.

@emersion
Copy link
Contributor

emersion commented Jan 27, 2020

is there any Wayland compositor supporting cursor protocol currently?

No, I stopped working on it because I became tired of all of this situation.

that xdg d-bus poop is a desktop-spanning standard though.

Nope. Using it for cursors was just a GNOME idea, nothing standard yet. Today, that xdg-desktop-portal settings API is as much of a standard as my WIP cursor protocol is.

@glaubersm
Copy link
Author

wip? then no Wayland compositor supports cursor protocol because it is not ready.

@ghost
Copy link

ghost commented Jan 27, 2020

Stupid true bullshit.

@CounterPillow
Copy link
Contributor

@glaubersm everything else correctly implements wl_cursor_theme_load though making this a non-issue. Only GNOME doesn't get this right.

@ddevault
Copy link
Contributor

No, it's fucking not, and that's why it's fucking stupid that we keep arguing about it. Put a fucking lid on it, @wm4.

@emersion
Copy link
Contributor

emersion commented Jan 27, 2020

wip? then no Wayland compositor supports cursor protocol because it is not ready.

As said above, no Wayland compositor supports the xdg-desktop-portal API neither. (Not even GNOME.)

@ghost
Copy link

ghost commented Jan 27, 2020

I will, once Wayland actually works.

@ddevault
Copy link
Contributor

waves in Wayland

@keithbowes
Copy link

@glaubersm is of course correct, gnome being a major Linux desktop, I can only blame the unreasonable pile of shit of a standard behind it.

Well, GNOME has sucked at least since I started using GNU/Linux, so surely no one expected it to get better just because we now have a superior replacement for X.

@diamondburned
Copy link

Why not just exec dconf read /org/gnome/desktop/interface/cursor-theme? Gives 'Ardoise_no_shadow_87', decent enough of an output imo

@glaubersm glaubersm changed the title mpv 0.31 does respect cursor theme on Gnome Wayland session mpv 0.31 does not respect cursor theme on Gnome Wayland session Feb 20, 2021
@Dudemanguy
Copy link
Member

Seems to work for me now using mpv from git and mutter 41.3. Didn't bother to look too deeply into it so I'll just assume this is fixed.

@glaubersm
Copy link
Author

Hi
Currently I'm using mpv 0.34.1 on Arch Linux running Gmome 41.3.
Now mpv always uses adwaita cursor theme. It does not respect 3rd-party cursor theme (tested BMZ theme - https://www.gnome-look.org/p/1158321/) nor cursor size setting of adwaita theme configurable in Accessibility module of Gnome settings.

@Dudemanguy
Copy link
Member

I'm using breeze (the kde theme) and it works for me at least.

@glaubersm
Copy link
Author

On my system mpv does not respect Breeze cursor theme too.

@zheneknew
Copy link

If Google brought you here too, you can use it

right_path=`eval echo "$HOME/.icons/$(dconf read /org/gnome/desktop/interface/cursor-theme)"` && symlink_path="$HOME/.icons/default" && if [ "`readlink $symlink_path`" != "$right_path" ]; then ln -nfs "$right_path" "$symlink_path" ; fi

You can insert it into crontab -e or create on system startup entry

@iuuky
Copy link

iuuky commented Jun 1, 2023

Posting also my solution for gnome that simply takes the cursors folder, finds its location on system and creates a link to it in defaults of (XDG) icons folder.

fix-gnome-x-mpv-cursor-theme.sh

#!/usr/bin/env sh
default_user_icons_folder="${XDG_DATA_HOME}/icons/default"
mkdir -p "${default_user_icons_folder}" 2> /dev/null
#cursor_theme_name=$(gsettings get org.gnome.desktop.interface cursor-theme | cut -d "'" -f 2)
cursor_theme_name=$(dconf read /org/gnome/desktop/interface/cursor-theme | cut -d "'" -f 2)
cursor_theme_location=$(find / -name "${cursor_theme_name}" 2> /dev/null | head -n 1)
cursor_icons_location="${cursor_theme_location}/cursors"
ln -nfs "${cursor_icons_location}" "${default_user_icons_folder}/"

@Dudemanguy
Copy link
Member

#11701 would fix this too if you still have this somehow. mutter always has the correct cursor theme for me when I try it nowadays so dunno. I remember it used to always pick adwaita.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants