Skip to content

Consider providing a build for Wayland #10915

Closed

Description

@LongChair
  • Electron version: any
  • Operating system: Linux

Expected behavior

Latest Ubuntu comes with Wayland a default display server.
On embedded devices, wayland provides usually the best rendering performance, at least compared to X11 where the performance is usually pretty poor.

Actual behavior

Current linux / arm / arm64 binary releases are great but run pretty bad from my experience on embedded devices. They all link to libx11 / gtk which makes them unusable for wayland.

libGtk can be build with --wayland-backend and then electron can be built against it

I would really like electron team to consider providing prebuilt binaries usable with wayland, that would open a new range of possibilities, especially on embedded devices.

Activity

  1. LongChair commented on Oct 29, 2017

    @LongChair
    Author

    After reading a bit, it looks like the best way to achieve this would be to enable ozone in the chromium build. So I wanted to know if someone ever did that or if i could get a few pointers to try it out ?
    Also are there any other parts of electron that would have strong X11 dependencies ? GTK3 shouldn't at this point but wondering if things like brightray have ?

  2. LongChair commented on Oct 31, 2017

    @LongChair
    Author

    Further look in the build shows that electron depends on chromium libgtkui.
    The libgtkui in chromium has kinda strong dependencies on X11 and will not builds on anything else than X11 / OSX / Win at this point.

    I'm not sure what libgtkui in chromium is used for (that's not in libgtk3).
    it looks like its for creating status icons and app indicators.
    I wonder if it would be possible to make that optional...

  3. LongChair commented on Nov 3, 2017

    @LongChair
    Author

    I have managed to patch libchromiumcontent to make it build without X11.
    This required quite a few patches and is not really suitable.

    libchromiumcontent can be built in that case with use_aura=true use_ozone=trueand some more parameters. for more details see my patches here https://github.com/LongChair/libchromiumcontent/commits/upgrade-to-chromium-61

    Then I started the electron build and the situation is similar. Although most of the code has some #if defined(USE_AURA) parts, it clearly cannot be build for aura with ozone at this point even though libgtk3ui would not depend on it.

    There are also bits in the brightray GYP files that make it X11 dependent, a wayland version would need there to link with the right displaymanager libs (wayland-client, ...) .

    I believe that the best way to make it buildable without too much hassle on linux and without X11 support, would be to make the libgtk3ui component use optionnal in the build. But I don't know electron enough to know what this would break / make unavailable. it seems it's mostly taskbar icons, which wouldn't matter much as there is no taskbar in weston anyways :)

    I guess i'll stop my attempt here as that makes too many patches and there has been no interest / feedback on this from electron team at this point :)

  4. admiral0 commented on Nov 6, 2017

    @admiral0

    This would allow running via a hack on ChromeOS as well.

  5. MarshallOfSound commented on Nov 6, 2017

    @MarshallOfSound
    Member

    This would allow running via a hack on ChromeOS as well.

    That has piqued my interest a bit, can you explain how that would work?

  6. admiral0 commented on Nov 6, 2017

    @admiral0

    Latest chromeos devices, the ones that bundle android runtime use wayland to display non-chrome apps.

    I have sucessfully compiled and run a hello wayland demo.

  7. LongChair commented on Nov 6, 2017

    @LongChair
    Author

    ChromeOS uses Aura & Ozone, either with Wayland or GBM/KMS.
    Still the issues mentionned above are the same. libgtkui is still the major issue for making a build, both within chromium & electron.

  8. onny commented on Nov 12, 2017

    @onny

    Nice progress @LongChair !
    I was also looking into that but prefered to test Chrome (Chromium) for Wayland first. I guess that the V8 engine is the biggest part for migration, both in Chrome and Electron.
    Igalia has a chromium fork which is close to upstream: https://github.com/Igalia/chromium
    Maybe we can integrate the Igalia patches into your Electron build?
    Well, I haven't been able to run Chromium on Wayland yet ...

  9. onny commented on Nov 21, 2017

    @onny
  10. LongChair commented on Nov 22, 2017

    @LongChair
    Author

    @onny : well as i meantionned before, it seems that a lot of X11 dependencies are still in electron itself because if the use of libgtkui in the libcc build.

    As far as i have seen electron also handles AURA as a build parameter but then assumes that aura/x11 is used. so there is not way currently to get it to build without X11.

    it will run on Xwayland / Wayland but this is far from bringing the wayland performance, especially on embedded.

  11. onny commented on Nov 28, 2017

    @onny

    Oh that is interesting:

    Electron is now using GTK3 in the master branch, will be shipped in next minor/major release.
    #2927 (comment)

    👍

  12. LongChair commented on Nov 29, 2017

    @LongChair
    Author

    @onny : yes that is what chromium 61 brings. this is progress.

    What i'm looking for is a full native wayland version of electron as X11 (Xwayland) tends to take the overal performance down by a bunch.
    For this there are two issues, even if Chromium builds and runs on native wayland, this is whthout libgtkui afaik. that dependency that libcc is adding to chromium build itself seems to be severely depending on X11 at this point.
    Then aside chromium, electron code itself relies both on libcc:gtkui, but also on a bunch of X11 functions which are not available on native wayland.

    I am not sure how that X11 dependency could be overcome. The following things would be required :

    • Get rid in electron of the licbc gtkui need. ? if not possible then have chromium make it X11 / Wayland compatible
    • Get rid of the X11 mandatory dependencies. Electron code seems to use AURA but assumes it's AURA X11 where it could be AURA / Wayland. I am not sure if there are any equivalents for the used X11 functions.

    It would have been nice if some electron devs could evaluate that or bring some feedback / techincal considerations here :)

  13. NeoTheThird commented on Mar 7, 2018

    @NeoTheThird

    Any news on this?

  14. 161 remaining items

  15. vially commented on Mar 2, 2021

    @vially
    Contributor

    There is nothing in the release notes about Wayland. I'm not sure what the criteria is for something to be mentioned in the release notes, but the Wayland support seems to be there and can be tested by installing the latest version and running:

    electron --enable-features=UseOzonePlatform --ozone-platform=wayland
    
  16. juxuanu commented on Mar 2, 2021

    @juxuanu

    This is a Chromium feature. Check Chromium's changelog for the Wayland news.

    This issue can be closed.

  17. iMonZ commented on Mar 2, 2021

    @iMonZ

    This is a Chromium feature. Check Chromium's changelog for the Wayland news.

    This issue can be closed.

    Has someone tested this feature?
    Is it approved?
    Until this happens why close the issue?

  18. juxuanu commented on Mar 2, 2021

    @juxuanu

    This is a Chromium feature. Check Chromium's changelog for the Wayland news.
    This issue can be closed.

    Has someone tested this feature?
    Is it approved?
    Until this happens why close the issue?

    I've been using Electron on Wayland for months now. Many people I know have, too.
    I don't understand what approval and from whom you expect.
    You can check for yourself on anything based on any of the last two major Chromium versions with the flags provided above.

  19. iMonZ commented on Mar 2, 2021

    @iMonZ

    This is a Chromium feature. Check Chromium's changelog for the Wayland news.
    This issue can be closed.

    Has someone tested this feature?
    Is it approved?
    Until this happens why close the issue?

    I've been using Electron on Wayland for months now. Many people I know have, too.
    I don't understand what approval and from whom you expect.
    You can check for yourself on anything based on any of the last two major Chromium versions with the flags provided above.

    Okay well that parameter worked fine but my window doesn't have borders or a top bar and I cannot move or resize the window 🤔️

  20. Synthetica9 commented on Mar 2, 2021

    @Synthetica9

    [...]

    Okay well that parameter worked fine but my window doesn't have borders or a top bar and I cannot move or resize the window thinking

    That's probably a client-side decorations thing, see here for a starting point

  21. vially commented on Mar 2, 2021

    @vially
    Contributor

    but my window doesn't have borders or a top bar and I cannot move or resize the window

    That's a known issue which is specific to GNOME (or more accurately specific to compositors which don't support server-side decorations).

    It has also been spun-out as a separate Electron feature request in #27522 (also related: #27016, #11907).

  22. jokeyrhyme commented on Mar 2, 2021

    @jokeyrhyme

    Congratulations on v12 :) <3

    Please close this issue and lock further comments, so individual topics around wayland polish can be raised separately

  23. ZanderBrown commented on Mar 2, 2021

    @ZanderBrown

    Being picky: It's not a bug with GNOME and it's not GNOME specific, however it's probably a Chrome issue

  24. RJVB commented on Oct 4, 2021

    @RJVB

    Congratulations on v12 :) <3

    Please close this issue and lock further comments, so individual topics around wayland polish can be raised separately

    Before I do that: is it already possible to set up things in such a way that Electron-based applications use Wayland automatically when it's available (or the only option)? If not, are there plans to do this and thus remove the need to remember and add --enable-features=UseOzonePlatform --ozone-platform=wayland each time you launch such an app?

  25. msisov commented on Oct 4, 2021

    @msisov
    Contributor
  26. sepehr commented on Dec 25, 2022

    @sepehr

    If the electron app runs as a flatpak, there's need for a flatpak override that:

    • exposes Wayland socket
    • sets GDK_BACKEND environment variable to wayland

    You can create this override with:

    flatpak override --user --socket=wayland $VENDOR
    GDK_BACKEND=wayland flatpak run $VENDOR --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations
    

    Where $VENDOR is the flatpak vendor, e.g. com.slack.Slack or org.signal.Signal. The override will be created under ~/.local/share/flatpak/overrides.

    Another convenient option is to use Flatseal. On Arch, you can override all Electron apps flags globally.


    P.S. been my first day back on a gnu/linux workstation battlefield.

  27. aaronliu0130 commented on May 14, 2023

    @aaronliu0130

    Apparently Chromium now supports native Wayland. Is there an update on this?

  28. fxzxmicah commented on Oct 23, 2024

    @fxzxmicah

    use_ozone=true ozone_auto_platforms=false ozone_platform="wayland" ozone_platform_wayland=true
    These parameters are required to build a wayland-based chromium.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked/upstream ❌enhancement ✨platform/linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions