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

Set wayland flags when appropiate #248

Closed
wants to merge 3 commits into from
Closed

Set wayland flags when appropiate #248

wants to merge 3 commits into from

Conversation

icarns
Copy link

@icarns icarns commented Nov 10, 2022

- WebRTCPipeWireCapturer: use Pipewire to stream

Since some flags depend on the Electron version and I don't know which version Discord bundles, this might require waiting.

@flathubbot
Copy link
Contributor

Started test build 6177

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/118624/com.discordapp.Discord.flatpakref

@icarns
Copy link
Author

icarns commented Nov 10, 2022

It seems to not be working... Any idea? It might be the Electron version

Discord uses Electron 13. We'll have to wait. Also, disabling WebRTCPipeWireCapturer since they use their own thing (and it's obviously broken on Linux).

@Etaash-mathamsetty
Copy link
Contributor

you might want to move this to discord canary which uses electron 17 atm.

@flathubbot
Copy link
Contributor

Started test build 12845

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/125276/com.discordapp.Discord.flatpakref

@flathubbot
Copy link
Contributor

Started test build 12849

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/125278/com.discordapp.Discord.flatpakref

@flathubbot
Copy link
Contributor

Started test build 12850

TingPing and others added 2 commits December 21, 2022 09:37
- `WebRTCPipeWireCapturer`: use Pipewire to stream
- `WaylandWindowDecorations`: show CSD (available since [electron17](electron/electron#29618))
- `--ozone-platform-hint=auto`: enable Wayland when possible

Since some flags depend on the Electron version and I don't know which version Discord bundles, this might require waiting.
Discord uses its custom thing that prevents this from working.
@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/125279/com.discordapp.Discord.flatpakref

@flathubbot
Copy link
Contributor

Started test build 12852

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/125281/com.discordapp.Discord.flatpakref

@retrixe
Copy link

retrixe commented Jan 14, 2023

Since this is using a script to start Discord anyway, I recommend setting --ozone-platform=wayland under a Wayland session. This works on electron 17, unlike the hint flag.

Also, I think WaylandWindowDecorations can be passed unconditionally?

@TingPing
Copy link
Member

So the latest discord does work under wayland, but it has no window decorations.

Until that is fixed upstream I don't think this should be done.

@Etaash-mathamsetty
Copy link
Contributor

So the latest discord does work under wayland, but it has no window decorations.

Until that is fixed upstream I don't think this should be done.

it's been fixed upstream for a while, just need discord to update electron again

@retrixe
Copy link

retrixe commented Jan 15, 2023

Not necessary, window decorations can be enabled by passing --enable-features=WaylandWindowDecorations on current Discord with Electron 17 as well.

So the latest discord does work under wayland, but it has no window decorations.
Until that is fixed upstream I don't think this should be done.

it's been fixed upstream for a while, just need discord to update electron again

Apart from screen sharing (which is now completely broken, previously it still worked for specific Xwayland windows), Discord is fully functional on Wayland natively for me with the flags in this PR now (however, --ozone-platform-hint=auto should be swapped with a conditional --ozone-platform=wayland).

@TingPing
Copy link
Member

TingPing commented Jan 15, 2023

--enable-features=WaylandWindowDecorations

Oh I missed that.

So I tested it again after the 0.0.24 update and now Wayland no longer works here...

flatpak run --socket=wayland com.discordapp.Discord --ozone-platform=wayland uses X11.

EDIT: Can confirm this is a regression: flatpak update --commit=a7ae06728d9d930d88d79a583c817834f356a7fea37e5a4b366b6758d7a68716 com.discordapp.Discord works

@lionirdeadman
Copy link
Collaborator

I've just realized that 0.0.24 is back on Electron 13.x. So, they were at 13.x with 0.0.22, upgraded to Electron 17.x with 0.0.23 then went back to Electron 13.x. This is why this regression happened. What a depressing thing to realize.

@Etaash-mathamsetty
Copy link
Contributor

Etaash-mathamsetty commented Jan 22, 2023

I've just realized that 0.0.24 is back on Electron 13.x. So, they were at 13.x with 0.0.22, upgraded to Electron 17.x with 0.0.23 then went back to Electron 13.x. This is why this regression happened. What a depressing thing to realize.

hopefully electron 17 will be back with 0.0.25
in the meantime somebody should port this to discord canary's flatpak

@orowith2os
Copy link

orowith2os commented Mar 26, 2023

0.0.25 still seems to be on Electron 13:

navigator.userAgent
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.25 Chrome/91.0.4472.164 Electron/13.6.6 Safari/537.36"```

@orowith2os
Copy link

0.0.26 is on 22, screensharing is broken though (Wayland). Probably should wait for them to fix that, or figure something out here.

@retrixe
Copy link

retrixe commented Apr 12, 2023

Screensharing will remain broken unless Discord updates their native screen-sharing module, I don't see a way around that unless Discord provides a flag to disable their native screen-sharing entirely.

It's already half-broken since it can only share other Xwayland apps, so the merit of delaying this PR for screen-sharing support is debatable. I can see some people might complain about it, I guess?

@Etaash-mathamsetty
Copy link
Contributor

Screensharing will remain broken unless Discord updates their native screen-sharing module, I don't see a way around that unless Discord provides a flag to disable their native screen-sharing entirely.

It's already half-broken since it can only share other Xwayland apps, so the merit of delaying this PR for screen-sharing support is debatable. I can see some people might complain about it, I guess?

you can use the xwayland video bridge to work around this for now

@TingPing
Copy link
Member

I believe it is a valid downside to some users.

We could start with a solution that lets users pick which they want, like an env var to opt-in or out.

@flathubbot
Copy link
Contributor

Started test build 37738

@flathubbot
Copy link
Contributor

Build 37738 failed

TingPing added a commit that referenced this pull request Apr 26, 2023
TingPing added a commit that referenced this pull request Apr 26, 2023
@TingPing
Copy link
Member

Replaced by #288.

The main difference is just some documentation and --ozone-platform-hint=auto is tied to --socket=wayland otherwise it failed to launch in a wayland session for me.

@TingPing TingPing closed this Apr 26, 2023
TingPing added a commit that referenced this pull request Apr 26, 2023
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

Successfully merging this pull request may close these issues.

None yet

7 participants