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

Spotify wayland has no themed cursor #239

Open
etrnal70 opened this issue Apr 21, 2023 · 20 comments
Open

Spotify wayland has no themed cursor #239

etrnal70 opened this issue Apr 21, 2023 · 20 comments
Labels

Comments

@etrnal70
Copy link

It's nice to see spotify finally supports wayland ootb (just toggling wayland socket from flatseal). One thing that i notice is that using wayland will reset the cursor to the default, black one.

This isn't an issue when using xwayland

@daenney
Copy link

daenney commented Apr 28, 2023

I get the impression that simply flicking the Wayland socket on doesn't actually make it run with Wayland. I tried this myself as it's one of the last remaining XWayland apps. But after setting the override and relaunching the app I still see it in the output of xlsclients.

Did you do something else to make this work by any chance?

@TingPing
Copy link
Member

At least with the current verison, it does not support wayland AFAICT.

@vially
Copy link

vially commented Apr 28, 2023

At least with the current verison, it does not support wayland AFAICT.

Actually it does work, but you need to manually pass in the Electron wayland flags. This is a sample desktop file for doing that (~/.local/share/applications/com.spotify.Client.desktop):

[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Online music streaming service
Comment=Access all of your favorite music
Icon=com.spotify.Client
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/extra/bin/spotify --file-forwarding com.spotify.Client --ozone-platform=wayland @@u %U @@
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;AudioVideo;
Keywords=Music;Player;Streaming;Online;
StartupWMClass=Spotify
X-GNOME-UsesNotifications=true
X-Flatpak-Tags=proprietary;
X-Flatpak=com.spotify.Client

@TingPing
Copy link
Member

Ah neat.

Testing it locally it shows corrupted rendering and then crashes though.

Once its broadly usable we should add detecting wayland to our launcher scripts.

@vially
Copy link

vially commented Apr 28, 2023

Testing it locally it shows corrupted rendering and then crashes though.

That's strange. Seems to work fine for me on sway.

@orowith2os
Copy link

Once its broadly usable we should add detecting wayland to our launcher scripts.

Why not add it now, but not enable it by default? Apparenty it works for some people, and it can be a simple override to allow it.

@orowith2os
Copy link

@etrnal70: where are your themes located? They should be in the appropriate XDG directories, not in directories like ~/.icons. Flatpak won't work with the legacy directories.

@TingPing
Copy link
Member

TingPing commented Apr 29, 2023

@orowith2os Patch welcome. See Discord package for example. It even has a workaround for this bug.

@orowith2os
Copy link

Indeed it does. I've submitted something upstream to Flatpak a while back, I think before this issue ever showed up. flatpak/flatpak#5375

@etrnal70
Copy link
Author

@etrnal70: where are your themes located? They should be in the appropriate XDG directories, not in directories like ~/.icons. Flatpak won't work with the legacy directories.

I believe they are placed in the default /usr/share/icons directory

@etrnal70
Copy link
Author

etrnal70 commented May 20, 2023

It got fixed in latest update ! Closing this then

EDIT: Nah no it's on xwayland. It's doesn't even use wayland now (even with flags)

@etrnal70 etrnal70 reopened this May 20, 2023
@juxuanu
Copy link

juxuanu commented Jun 23, 2023

You can run spotify on wayland with flatpak run com.spotify.Client --enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer --ozone-platform=wayland --disable-gpu-sandbox.

I recommend using the same method Discord Flatpak uses, which works fine, which tweaked for Spotify (since it's not Electron, but an older CEF) would look like:

FLAGS='--enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer '

WAYLAND_SOCKET=${WAYLAND_DISPLAY:-"wayland-0"}

if [[ -e "$XDG_RUNTIME_DIR/${WAYLAND_SOCKET}" ]]
then
    FLAGS="$FLAGS --ozone-platform=wayland"
fi

if [[ $XDG_SESSION_TYPE == "wayland" ]] && [ -c /dev/nvidia0 ]
then
    FLAGS="$FLAGS --disable-gpu-sandbox"
fi

imatge

@trevnels
Copy link

trevnels commented Jul 2, 2023

I noticed the unthemed cursor behavior too with most chromium-based apps running under Wayland (notably also Discord). The fix for me was to add XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons as an environment variable to affected flatpaks, though YMMV. Seems a little weird to be passing X-related variables into a full Wayland client but it seems to work.

@orowith2os
Copy link

They're not exactly X-only, they were just grandfathered in; they're still valid variables on Wayland, and I don't think there's any other alternative to em. They work fine, no reason to not use em.

Keeping in mind this only applies to some X variables, like XCURSOR_PATH.

@sakithb
Copy link

sakithb commented Nov 19, 2023

You can run spotify on wayland with flatpak run com.spotify.Client --enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer --ozone-platform=wayland --disable-gpu-sandbox.

I recommend using the same method Discord Flatpak uses, which works fine, which tweaked for Spotify (since it's not Electron, but an older CEF) would look like:

FLAGS='--enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer '

WAYLAND_SOCKET=${WAYLAND_DISPLAY:-"wayland-0"}

if [[ -e "$XDG_RUNTIME_DIR/${WAYLAND_SOCKET}" ]]
then
    FLAGS="$FLAGS --ozone-platform=wayland"
fi

if [[ $XDG_SESSION_TYPE == "wayland" ]] && [ -c /dev/nvidia0 ]
then
    FLAGS="$FLAGS --disable-gpu-sandbox"
fi

imatge

I managed to launch spotify on wayland. Is there any way to remove the default chromium titlebar?

@TingPing
Copy link
Member

I managed to launch spotify on wayland. Is there any way to remove the default chromium titlebar?

Maybe --enable-features=UseSkiaRenderer,WaylandWindowDecorations

@Bu156
Copy link

Bu156 commented Nov 30, 2023

WaylandWindowDecorations seems to do nothing, otherwise Spotify in Wayland mode is a much better experience for me, as games can't grab the input from Spotify in the background.

@ahjolinna
Copy link

ahjolinna commented Feb 28, 2024

You can run spotify on wayland with flatpak run com.spotify.Client --enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer --ozone-platform=wayland --disable-gpu-sandbox.
I recommend using the same method Discord Flatpak uses, which works fine, which tweaked for Spotify (since it's not Electron, but an older CEF) would look like:

FLAGS='--enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer '

WAYLAND_SOCKET=${WAYLAND_DISPLAY:-"wayland-0"}

if [[ -e "$XDG_RUNTIME_DIR/${WAYLAND_SOCKET}" ]]
then
    FLAGS="$FLAGS --ozone-platform=wayland"
fi

if [[ $XDG_SESSION_TYPE == "wayland" ]] && [ -c /dev/nvidia0 ]
then
    FLAGS="$FLAGS --disable-gpu-sandbox"
fi

imatge

I managed to launch spotify on wayland. Is there any way to remove the default chromium titlebar?

when I launched the spotify with wayland using these settings on plasma6 (using Nvidia GPU) it seems to get rid of the horrible xwayland flickering issue thats on nvidia, and it runs much smoother in general

would be nice if this could be added, or at least be opt-in as discord has

only minor issue is I notice is that now you will see the generic Wayland icons, not sure if its app bug or what


my spec:

Operating System: openSUSE MicroOS 20240226
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.6-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Memory: 46.8 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2

@TingPing
Copy link
Member

would be nice if this could be added, or at least be opt-in as discord has

Please open a PR doing the same.

@hoshsadiq
Copy link

When running with all of this, my cursor is in the wrong place. It's the correct size and theme, but the hovers and clicks register in different places from where my cursor is. In some cases, it's a couple of inches (15 inch screen) to the bottom right of the cursor, but in others places it's 4-5 inches away. I do get some errors when running on the command line:

$ flatpak run --user --socket=wayland --nosocket=x11 --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons com.spotify.Client
/app/extra/bin/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/bin/spotify)
[spotifywm] attached to spotify

Traceback (most recent call last):
  File "/app/bin/set-dark-theme-variant.py", line 11, in <module>
    disp = Xlib.display.Display()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/app/lib/python3.11/site-packages/Xlib/protocol/display.py", line 84, in __init__
    name, protocol, host, displayno, screenno = connect.get_display(display)
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/Xlib/support/connect.py", line 73, in get_display
    return mod.get_display(display)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/Xlib/support/unix_connect.py", line 59, in get_display
    raise error.DisplayNameError(display)
Xlib.error.DisplayNameError: Bad display name ""
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
[spotifywm] attached to spotify
[spotifywm] attached to spotify
Opening in existing browser session.
libnotify-Message: 10:44:28.035: App Name is not available when using Portal Notifications

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

No branches or pull requests