flathub / io.freetubeapp.FreeTube

https://flathub.org/apps/details/io.freetubeapp.FreeTube
15 stars 10 forks source link

Add Wayland Support #93

Closed JoshuaMacklin closed 7 months ago

JoshuaMacklin commented 1 year ago

After adding the correct flags for Electron, and using the right sockets, this PR will add native wayland support and fixes the stuttering that was happening under xwayland ( issue #85 ).

This will also remove the "Legacy windowing system (X11)" alert on Flathub.

Tested under Wayland and X11

flathubbot commented 1 year ago

Started test build 75242

flathubbot commented 1 year ago

Build 75242 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/57876/io.freetubeapp.FreeTube.flatpakref
flathubbot commented 1 year ago

Started test build 75248

flathubbot commented 1 year ago

Build 75248 failed

flathubbot commented 1 year ago

Started test build 75249

flathubbot commented 1 year ago

Build 75249 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/57883/io.freetubeapp.FreeTube.flatpakref
flathubbot commented 1 year ago

Started test build 75254

flathubbot commented 1 year ago

Started test build 75257

flathubbot commented 1 year ago

Build 75254 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/57888/io.freetubeapp.FreeTube.flatpakref
flathubbot commented 1 year ago

Build 75257 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/57891/io.freetubeapp.FreeTube.flatpakref
efb4f5ff-1298-471a-8973-3d47447115dc commented 1 year ago

@bbhtt any thoughts on these changes. Also i just remembered that u also created a PR in the past similar tot this #81

U also mentioned

The x11 socket is still needed as it defaults to that, fallback-x11 won't work

Does this still apply?

bbhtt commented 1 year ago

https://github.com/flathub/io.freetubeapp.FreeTube/pull/81#issuecomment-1612502019 I'd still prefer an optional switch like Signal, but it's your choice.

Does this still apply?

No freetube updated to a recent enough Electron in the meantime and the the flag is used by default.

If however, it is made optional, x11 socket will need to be reintroduced I think.

JoshuaMacklin commented 1 year ago

Signal used the optional when Chromium, Electron, and Wayland was broken to explain that it was experimental. Electron has since fixed this issue so the optional shouldn't be needed as everything will work normally. Their solution also makes wayland support opt in rather than the simpler solution being wayland and x11 working out of the box depending on the users install (which is how the code is set up currently).

bbhtt commented 1 year ago

that it was experimental

It is still experimental, Electron does not default to native Wayland on a wayland session

efb4f5ff-1298-471a-8973-3d47447115dc commented 11 months ago

@JoshuaMacklin i noticed that the requested changes aren't implemented yet. Do you need additional help with something?

JoshuaMacklin commented 10 months ago

My apologies, life gets in the way! I haven't ever implemented anything like the signal toggle before, if anyone who has done it before would to help with the implementation or point me in the right direction, that'd be awesome!

bbhtt commented 10 months ago

My apologies, life gets in the way! I haven't ever implemented anything like the signal toggle before, if anyone who has done it before would to help with the implementation or point me in the right direction, that'd be awesome!

https://bbhtt.github.io/flatpak-docs/electron.html#sandbox-permissions

Something like this will work:

#!/bin/sh

FLAGS=''

if [ "$XDG_SESSION_TYPE" = "wayland" ] && [ -e "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" ]; then
    FLAGS="$FLAGS --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations"
fi

env TMPDIR="$XDG_RUNTIME_DIR/app/${FLATPAK_ID:-io.freetubeapp.FreeTube}" zypak-wrapper /app/freetube/freetube "$FLAGS" "$@"

Replace run.sh here https://github.com/flathub/io.freetubeapp.FreeTube/blob/b6bf189bfb2e1a466d53bceccbf13c3968856f31/io.freetubeapp.FreeTube.yml#L42-L46 with that. Then just keep --socket=x11.

flathubbot commented 10 months ago

Started test build 93667

flathubbot commented 10 months ago

Build 93667 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/76413/io.freetubeapp.FreeTube.flatpakref
flathubbot commented 10 months ago

Started test build 93673

flathubbot commented 10 months ago

Build 93673 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/76419/io.freetubeapp.FreeTube.flatpakref
JoshuaMacklin commented 10 months ago

Tested and works on both x11 and wayland! Thank you for the guidance!

efb4f5ff-1298-471a-8973-3d47447115dc commented 10 months ago

if @bbhtt then this will get merged right before upcoming release, no ETA on upcoming release but will be soon!

bbhtt commented 10 months ago

bot, build

flathubbot commented 10 months ago

Queued test build for io.freetubeapp.FreeTube.

flathubbot commented 10 months ago

Started test build 94915

flathubbot commented 10 months ago

Build 94915 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/77664/io.freetubeapp.FreeTube.flatpakref
JoshuaMacklin commented 10 months ago

if @bbhtt then this will get merged right before upcoming release, no ETA on upcoming release but will be soon!

Sounds good! Can't wait for the updated Electron :)

JoshuaMacklin commented 10 months ago

bot, build

flathubbot commented 10 months ago

Queued test build for io.freetubeapp.FreeTube.

flathubbot commented 10 months ago

Started test build 95486

flathubbot commented 10 months ago

Build 95486 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/78233/io.freetubeapp.FreeTube.flatpakref
JoshuaMacklin commented 8 months ago

shall we rebase this branch to get it included into the 0.19.2 update?

efb4f5ff-1298-471a-8973-3d47447115dc commented 8 months ago

No 0.20.0 will be coming very soon. Ill make sure to notify Preston about it when we going to put out the release.

zestygrass commented 8 months ago

Hey @JoshuaMacklin Can the following flags be added to this pr or a different pr? These enable hardware acceleration of Wayland

--enable-features=VaapiVideoDecodeLinuxGL 
--gpu-context=wayland
efb4f5ff-1298-471a-8973-3d47447115dc commented 7 months ago

@zestygrass IMO that is out of scope of this PR

JoshuaMacklin commented 7 months ago

Hey @JoshuaMacklin Can the following flags be added to this pr or a different pr? These enable hardware acceleration of Wayland

--enable-features=VaapiVideoDecodeLinuxGL 
--gpu-context=wayland

I'd agree its out of scope for this PR, I tested it however I didn't see any change in CPU or GPU utilization on the app in wayland. If you can prove it working in an issue / pr, I'm sure someone would be happy to implement it.

flathubbot commented 7 months ago

Started test build 112171

flathubbot commented 7 months ago

Build 112171 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/94985/io.freetubeapp.FreeTube.flatpakref
efb4f5ff-1298-471a-8973-3d47447115dc commented 7 months ago

Flathub is having some issues with getting this merged. We're working on it!

flathubbot commented 7 months ago

Started test build 112513

flathubbot commented 7 months ago

Build 112513 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/95323/io.freetubeapp.FreeTube.flatpakref