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

Wayland rendering backend not working #159

Closed
3 of 5 tasks
theCalcaholic opened this issue Jun 25, 2022 · 13 comments
Closed
3 of 5 tasks

Wayland rendering backend not working #159

theCalcaholic opened this issue Jun 25, 2022 · 13 comments
Assignees
Labels
info:upstream Issue with WebCord's depencencies / thirdparty software info:Wayland Issues specific to Wayland, likely caused by lack of support by Electron / Chromium. status:wontfix This will not be worked on type:bug Something isn't working

Comments

@theCalcaholic
Copy link

Aknowledgements

  • I have checked that there's no other issue describing the same or
    similar problem that I currently have, regardless if it has been
    closed or open.

  • I can confirm that this is not an issue with the Discord website,
    but it is a problem specific to the WebCord itself.

  • I have tried running the build from the master branch and it does
    not have any fixes implemented according to my issue.

  • My issue describes one of the unstable and/or not fully implemented
    features.

  • I have found a workaround to mitigate or temporarily fix this issue
    (please write it in Additional context section).

Operating System / Platform

🐧️ Linux

Operating system architecture

x64 (64-bit Intel/AMD)

Electron version

19.0.6

Application version

v3.3.0

Bug description

Summary
Electron has massive input lag for text fields under Wayland, at least if an Nvidia GPU is being used. Chrome's/Electron's new
Ozone Wayland rendering backend can't be enabled

Details:

Electron works a lot better, when using the native Ozone Wayland rendering backend, which can be enabled with the flags --enable-features=UseOzonePlatform --ozone-platform=wayland.

I have successfully applied this workaround to a bunch of different Electron apps (e.g. Element, Visual Studio Code...), however, when trying to do the same for Webcord, the application crashes with a segfault:

$ /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=run.sh io.github.spacingbat3.webcord --enable-features=UseOzonePlatform --ozone-platform=wayland
[4:0625/154538.352902:ERROR:wayland_connection.cc(209)] Failed to connect to Wayland display
[4:0625/154538.352924:ERROR:ozone_platform_wayland.cc(226)] Failed to initialize Wayland platform
[4:0625/154538.352932:ERROR:env.cc(226)] The platform failed to initialize.  Exiting.
/app/bin/run.sh: line 16:     4 Segmentation fault      (core dumped) env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/bin/webcord $FLAGS "$@"

Does this maybe require a compile flag to be enabled?

Additional context

My System:

OS: Fedora 36
GPU: Nvidia RTX 3080
graphics driver: proprietary nvidia driver, version 510
Desktop Environment: Gnome 42.2

@theCalcaholic theCalcaholic added the type:bug Something isn't working label Jun 25, 2022
@theCalcaholic theCalcaholic changed the title Input lag on Wayland + Nvidia Wayland rendering backend not working Jun 25, 2022
@SpacingBat3
Copy link
Owner

I guess you're using Flatpaks – and why I can't blame you for that, you should know that WebCord's Flathub repository is entirely maintained by the community. See #116.

(...) which can be enabled with the flags --enable-features=UseOzonePlatform --ozone-platform=wayland.

Actually, --enable-features flag is redudant. Not only because ozone is used by the default now in Chromium engine even for X11, but also because WebCord does apply it automatically when it detects --ozone-platform=wayland as well as other tweaks that may help the users to have WebCord functional under native Wayland like client-side decoration (which is quite experimental in Electron and might still not be functional properly).

Electron has massive input lag for text fields under Wayland, at least if an Nvidia GPU is being used.

Have you tried turning on GPU optimizations in settings to test if that will help with at least few performance issues?

Chrome's/Electron's new Ozone Wayland rendering backend can't be enabled.

I'm not sure, but it could be because of Wayland not being passed to WebCord by Flatpak:

https://github.com/flathub/io.github.spacingbat3.webcord/blob/master/io.github.spacingbat3.webcord.yml#L9-L14

You should try to open the issue at WebCord's Flathub repository in that case.

@SpacingBat3 SpacingBat3 added the status:need-info Further information is requested label Jun 26, 2022
@etrnal70
Copy link

etrnal70 commented Jun 27, 2022

Can confirm manually enabling wayland permission (using Flatseal) make it work. But for some reason it did not automatically use wayland platform (i already manually set XDG_SESSION_TYPE=wayland). So the --ozone-platform=wayland is still required to enable proper wayland support. I test this using xeyes

EDIT: Ah looks like the flags is actually required for proper wayland support, sorry

@TheEvilSkeleton
Copy link

But for some reason it did not automatically use wayland platform (i already manually set XDG_SESSION_TYPE=wayland). So the --ozone-platform=wayland is still required to enable proper wayland support.

That's due to Electron/Chromium. They're quite unstable on Wayland, so it's only optional.

@SpacingBat3
Copy link
Owner

SpacingBat3 commented Jun 29, 2022

That's due to Electron/Chromium. They're quite unstable on Wayland, so it's only optional.

In addition to this, I've tried to inject the --ozone-platform flag into the Chromium engine using the commandLine Electron API, but it didn't seem to work. I guess it is parsed even before Electron has executed the main script (most flags don't, which is why they're working fine). This is why this flag is a requirement for now.

@SpacingBat3 SpacingBat3 added status:need-info Further information is requested and removed status:need-info Further information is requested labels Jun 29, 2022
@fontivan
Copy link

Using the rpm installation I get a different experience then reported above.

WebCord does launch using --ozone-platform and I can see that it is running native wayland and mostly works however there are some issues:

  1. The left side of the application is corrupted
  2. The title bar with the x button is missing
  3. It does not fill the screen when maximized
  4. Unable to open the file/edit/view/window/help menus

Blue squares were added to remove some personal information however you can see the difference between the two despite both being maximized.

I am using Fedora 36 and WebCord 3.5.0.

Native wayland:
native-wayland

XWayland:
xwayland

@TheEvilSkeleton
Copy link

Can confirm on WebCord flatpak.

@TheEvilSkeleton
Copy link

Likely related to electron/electron#34820.

@fontivan
Copy link

Using the rpm installation I get a different experience then reported above.

WebCord does launch using --ozone-platform and I can see that it is running native wayland and mostly works however there are some issues:

1. The left side of the application is corrupted

2. The title bar with the x button is missing

3. It does not fill the screen when maximized

4. Unable to open the file/edit/view/window/help menus

Blue squares were added to remove some personal information however you can see the difference between the two despite both being maximized.

I am using Fedora 36 and WebCord 3.5.0.

Native wayland: native-wayland

XWayland: xwayland

I believe most of the issues I was seeing will be fixed in electron/electron#34955

@SpacingBat3
Copy link
Owner

I believe most of the issues I was seeing will be fixed in electron/electron#34955

Great find! Althrough the original issue was because of Flatpaks, I may leave this open to track this pull request.

@SpacingBat3 SpacingBat3 added info:upstream Issue with WebCord's depencencies / thirdparty software status:wontfix This will not be worked on info:Wayland Issues specific to Wayland, likely caused by lack of support by Electron / Chromium. labels Jul 18, 2022
@xDShot
Copy link

xDShot commented Jul 29, 2022

Install flatpak version
Install https://wiki.archlinux.org/title/Xdg-desktop-portal (probably already installed as dependency)
Install one of portals
Install flatseal, give permission to webcord for flatpak
Profit

@SpacingBat3
Copy link
Owner

The PR has been recently merged into upstream and is present in Electron 20.0.2!

I guess I will close this issue and mark it as resolved. The issue will be resolved on the next release (since it will automatically bump Electron to the latest supported version).

@fontivan
Copy link

fontivan commented Sep 1, 2022

Using the rpm installation I get a different experience then reported above.
WebCord does launch using --ozone-platform and I can see that it is running native wayland and mostly works however there are some issues:

1. The left side of the application is corrupted

2. The title bar with the x button is missing

3. It does not fill the screen when maximized

4. Unable to open the file/edit/view/window/help menus

Blue squares were added to remove some personal information however you can see the difference between the two despite both being maximized.
I am using Fedora 36 and WebCord 3.5.0.
Native wayland: native-wayland
XWayland: xwayland

I believe most of the issues I was seeing will be fixed in electron/electron#34955

All the issues I observed previously are fixed in 3.8.1; Wayland is working great for me now!
In particular I am using the following launch options:

--ozone-platform=wayland --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer

@SpacingBat3
Copy link
Owner

--ozone-platform-hint=auto 
--enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer

@fontivan The last two shouldn't be required through, WebCord should apply these automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:upstream Issue with WebCord's depencencies / thirdparty software info:Wayland Issues specific to Wayland, likely caused by lack of support by Electron / Chromium. status:wontfix This will not be worked on type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants