Electron: Consider providing a build for Wayland

Created on 25 Oct 2017  ·  139Comments  ·  Source: electron/electron

  • 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.

blockeupstream ❌ enhancement platforlinux

Most helpful comment

Update: We (Igalia) are currently working on migrating legacy Chromium/Linux (aka: Aura/X11) to Ozone (crbug.com/789065), so that the X11 or Wayland Ozone backend can be selected accordingly at runtime. Furthermore, there's a requirement of being able to switch between Ozone and legacy at runtime as a fallback mechanism in case things go wrong during this transitional period. Once this is done, and wayland backend is properly polished and tested, it will hopefully make its way into Chromium/Linux official releases.

It's great to hear that vscode/electron is already able to run on top of chromium ozone/wayland (I need to find some time to give it a try by myself :)). Thanks for working and sharing this.

For further follow-up, please reach out to us at {nickdiego,msisov}@igalia.com

All 139 comments

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 ?

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...

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 :)

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

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?

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.

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.

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 ...

I was able to compile and run chromium with wayland patches! See the build script here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chromium-wayland-git

@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.

Oh that is interesting:

Electron is now using GTK3 in the master branch, will be shipped in next minor/major release.
https://github.com/electron/electron/issues/2927#issuecomment-347092515

👍

@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 :)

Any news on this?

hi! I just wanted to share that we (from Igalia) have support for Wayland in both Chromium (the browser) and Content (the embedding layer) levels in https://github.com/Igalia/chromium/.

So depending on how one configures electron on top of a regular chromium/x11 build today, it might be really straightforward to try it out on top of chromium/wayland.

The biggest differences are that:

  • chromium/wayland builds have "ozone" enabled.
  • chromium/wayland runs on top of the the under development "UI service", in chromium-land.

please reach me out at \tonikitoo at igalia dot com\, if one wants to follow up on this.

does anyone find a solution to run Electron without X11?

@tonikitoo do you have any indication of when your work on Wayland will be integrated back upstream?

@luispabon the work is being actively upstream. We estimate that about 85% is already in chromium's mainline.

/cc @msisov

@tonikitoo excelente 👍

hi @tonikitoo, any good news regarding electron with xwayland, wayland or weston?

we are not working on electron, but rather adding support for wayland in Chromium :)

crbug.com/578890

Any news on wayland support? I would love to see VSCode running natively on wayland rather than Xwayland.

@GitHubRepositoryX follow the progress of the crbug issue in the comment previous to yours, it's still actively getting updated.

I noticed that chromium has recently been patched to support libgtkui on ozone (both X11 and Wayland): https://chromium-review.googlesource.com/c/chromium/src/+/1744372

So that would likely solve the issue that @LongChair mentioned, since libgtkui can still be used on ozone wayland.

I tried turning on the ozone/wayland build flags and hacked away at some problems, and I managed to get it to a point where it works! Code still needs to be cleaned up, tested, and separated into smaller changes before I make PRs, but here is the branch: https://github.com/electron/electron/compare/master...hedgepigdaniel:ozone?expand=1

DPI change awareness (https://github.com/electron/electron/issues/11050) works perfectly as it does in ozone/wayland chromium builds, and the missing parts of that are similarly broken, e.g. no file open dialogs yet (although I think they are being worked on now).

For the most part the change is just separating use of the USE_X11 defines (which previously conflated linux and X11) with combinations of OS_LINUX and USE_X11 or USE_OZONE.

USE_X11 will be removed from the chromium codebase soon as we are getting closer to having Ozone/X11 and Ozone/Wayland without plain X11.

Also, to be able to use file dialogs and gtk, you must compile ozone with use_glib=true enabled. IIRC, use_gtk is set to true by default.

So is it a better idea to replace if use_x11 with if !use_ozone and os_linux? Or something else?

I will try with the use_glib flag. I take it that file dialogs are working then?

Yes, right. Though, the modality does not work yet. But you can use them.

this would be really phenomenal. Maybe we could also get scrolling on linux to be as nice as on windows. (kinetic)

Arch users: https://aur.archlinux.org/packages/electron-ozone

I've got it working with the latest VSCode (code-git just needs to be patched to use electron rather than electron6 following https://github.com/microsoft/vscode/pull/83796)

There's a few strange symptoms (probably me commenting out code I don't understand) - but it works. So sharp, and so correctly sized!

@hedgepigdaniel were you going to create PRs with your changes? I just tried checking out and compiling electron using the gn flags from your PKGBUILD but I get compile errors...stuff like:

../../ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc:53:15: error: no member named 'find_if' in namespace 'std'
(easy fix: just #include <algorithm>)
../../electron/shell/browser/ui/x/window_state_watcher.cc:59:32: error: no member named 'xproperty' in 'ui::Event'
  ::Atom changed_atom = event->xproperty.atom;
                        ~~~~~  ^
../../electron/shell/browser/ui/x/window_state_watcher.cc:61:18: error: reference to non-static member function must be called; did you mean to call it with no arguments?
          event->type == PropertyNotify && event->xproperty.window == widget_);
          ~~~~~~~^~~~
                     ()
../../electron/shell/browser/ui/x/window_state_watcher.cc:61:51: error: no member named 'xproperty' in 'ui::Event'
          event->type == PropertyNotify && event->xproperty.window == widget_);
                                           ~~~~~  ^

(these might be fixed by your conditional compiles?)

looks like these might be fixed by your commits?

Update: We (Igalia) are currently working on migrating legacy Chromium/Linux (aka: Aura/X11) to Ozone (crbug.com/789065), so that the X11 or Wayland Ozone backend can be selected accordingly at runtime. Furthermore, there's a requirement of being able to switch between Ozone and legacy at runtime as a fallback mechanism in case things go wrong during this transitional period. Once this is done, and wayland backend is properly polished and tested, it will hopefully make its way into Chromium/Linux official releases.

It's great to hear that vscode/electron is already able to run on top of chromium ozone/wayland (I need to find some time to give it a try by myself :)). Thanks for working and sharing this.

For further follow-up, please reach out to us at {nickdiego,msisov}@igalia.com

I cannot believe this is finally happening, a dream comes true... Hopefully it won't take that long to merge ppc64le patches 🤞

Running arch/sway, building electron-ozone seem to go smoothly, but then when I run electron:

electron -i

[57306:0311/201354.632474:FATAL:ozone_platform_wayland.cc(171)] Failed to initialize Wayland platform

please leave here what do these two commands

echo $WAYLAND_DISPLAY
echo $XDG_RUNTIME_DIR

show.

 ~ echo $WAYLAND_DISPLAY
wayland-0
 ~ echo $XDG_RUNTIME_DIR
/run/user/1000

I get the exact same error as @garth using @hedgepigdaniel's electron-ozone package (I'm also on arch/sway).

On the same machine chromium-ozone runs fine though (except for some minor issues like context menu/select input misplacement: chromium#1052685).

ok, try to run the app the following way:

WAYLAND_DISPLAY=1 ./your-app.

Does it work now? If not, please try to run with WAYLAND_DEBUG=1 and share the output. Thanks

I get the exact same error as @garth using @hedgepigdaniel's electron-ozone package (I'm also on arch/sway).

On the same machine chromium-ozone runs fine though (except for some minor issues like context menu/select input misplacement: chromium#1052685).

I didn't see it. Thanks for posting this link here. It will be triaged and fixed.

Under Sway:

 ~ WAYLAND_DISPLAY=1 electron -i
> [130498:0312/123434.824982:FATAL:ozone_platform_wayland.cc(171)] Failed to initialize Wayland platform

I also tested with Gnome and it works.

it should be

WAYLAND_DISPLAY=wayland-1 (if such display socket exists)


According to my env it should be wayland-0, but I tried 0 and 1 with the same effect. Here is the debug output.

 ~ WAYLAND_DISPLAY=wayland-0 WAYLAND_DEBUG=1 electron -i
> [430007.888]  -> [email protected]_registry(new id wl_registry@2)
[430007.898]  -> [email protected](new id wl_callback@3)
[430008.013] [email protected]_id(3)
[430008.020] [email protected](1, "wl_shm", 1)
[430008.028]  -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[430008.040] [email protected](2, "zwp_linux_dmabuf_v1", 3)
[430008.051]  -> [email protected](2, "zwp_linux_dmabuf_v1", 3, new id [unknown]@5)
[430008.062]  -> [email protected](new id wl_callback@6)
[430008.066] [email protected](3, "wl_drm", 2)
[430008.075] [email protected](4, "wl_compositor", 4)
[430008.087]  -> [email protected](4, "wl_compositor", 4, new id [unknown]@7)
[430008.124] [email protected](5, "wl_subcompositor", 1)
[430008.136]  -> [email protected](5, "wl_subcompositor", 1, new id [unknown]@8)
[430008.152] [email protected](6, "wl_data_device_manager", 3)
[430008.161]  -> [email protected](6, "wl_data_device_manager", 3, new id [unknown]@9)
[430008.209] [email protected](7, "zwlr_gamma_control_manager_v1", 1)
[430008.220] [email protected](8, "gtk_primary_selection_device_manager", 1)
[430008.232] [email protected](9, "zxdg_output_manager_v1", 3)
[430008.244] [email protected](10, "org_kde_kwin_idle", 1)
[430008.257] [email protected](11, "zwp_idle_inhibit_manager_v1", 1)
[430008.269] [email protected](12, "zwlr_layer_shell_v1", 2)
[430008.281] [email protected](13, "xdg_wm_base", 2)
[430008.293] [email protected](14, "zwp_tablet_manager_v2", 1)
[430008.304] [email protected](15, "org_kde_kwin_server_decoration_manager", 1)
[430008.317] [email protected](16, "zxdg_decoration_manager_v1", 1)
[430008.329] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[430008.340] [email protected](18, "zwp_pointer_constraints_v1", 1)
[430008.352] [email protected](19, "wp_presentation", 1)
[430008.364]  -> [email protected](19, "wp_presentation", 1, new id [unknown]@10)
[430008.380] [email protected](20, "zwlr_output_manager_v1", 1)
[430008.391] [email protected](21, "zwlr_export_dmabuf_manager_v1", 1)
[430008.402] [email protected](22, "zwlr_screencopy_manager_v1", 2)
[430008.414] [email protected](23, "zwlr_data_control_manager_v1", 2)
[430008.427] [email protected](24, "zwp_primary_selection_device_manager_v1", 1)
[430008.437] [email protected](25, "zwp_virtual_keyboard_manager_v1", 1)
[430008.449] [email protected](26, "zwlr_virtual_pointer_manager_v1", 1)
[430008.461] [email protected](27, "zwlr_input_inhibit_manager_v1", 1)
[430008.473] [email protected](28, "wl_seat", 7)
[430008.499]  -> [email protected](28, "wl_seat", 4, new id [unknown]@11)
[430008.516]  -> [email protected]_data_device(new id wl_data_device@12, wl_seat@11)
[430008.526] [email protected](29, "zwp_pointer_gestures_v1", 1)
[430008.538] [email protected](30, "wl_output", 3)
[430008.548]  -> [email protected](30, "wl_output", 3, new id [unknown]@13)
[430008.583] [email protected](241)
[430008.698] [email protected]_id(6)
[430008.716] [email protected](1211384385, 0, 0)
[430008.723] [email protected](1211384385, 16777216, 1)
[430008.729] [email protected](1211384385, 16777216, 2)
[430008.736] [email protected](1211384385, 16777216, 4)
[430008.762] [email protected](1211384408, 0, 0)
[430008.771] [email protected](1211384408, 16777216, 1)
[430008.781] [email protected](1211384408, 16777216, 2)
[430008.803] [email protected](1211384408, 16777216, 4)
[430008.832] [email protected](808669761, 0, 0)
[430008.844] [email protected](808669761, 16777216, 1)
[430008.856] [email protected](808669761, 16777216, 2)
[430008.868] [email protected](808669784, 0, 0)
[430008.880] [email protected](808669784, 16777216, 1)
[430008.891] [email protected](808669784, 16777216, 2)
[430008.903] [email protected](808665665, 0, 0)
[430008.913] [email protected](808665665, 16777216, 1)
[430008.925] [email protected](808665665, 16777216, 2)
[430008.937] [email protected](808665688, 0, 0)
[430008.948] [email protected](808665688, 16777216, 1)
[430008.958] [email protected](808665688, 16777216, 2)
[430008.969] [email protected](875713089, 0, 0)
[430008.981] [email protected](875713089, 16777216, 1)
[430009.006] [email protected](875713089, 16777216, 2)
[430009.035] [email protected](875713089, 16777216, 4)
[430009.046] [email protected](875708993, 0, 0)
[430009.058] [email protected](875708993, 16777216, 1)
[430009.069] [email protected](875708993, 16777216, 2)
[430009.081] [email protected](875708993, 16777216, 4)
[430009.093] [email protected](875713112, 0, 0)
[430009.105] [email protected](875713112, 16777216, 1)
[430009.129] [email protected](875713112, 16777216, 2)
[430009.141] [email protected](875713112, 16777216, 4)
[430009.152] [email protected](875709016, 0, 0)
[430009.183] [email protected](875709016, 16777216, 1)
[430009.193] [email protected](875709016, 16777216, 2)
[430009.204] [email protected](875709016, 16777216, 4)
[430009.230] [email protected](892424769, 0, 0)
[430009.261] [email protected](892424769, 16777216, 1)
[430009.272] [email protected](892424769, 16777216, 2)
[430009.285] [email protected](909199186, 0, 0)
[430009.297] [email protected](909199186, 16777216, 1)
[430009.310] [email protected](909199186, 16777216, 2)
[430009.320] [email protected](538982482, 0, 0)
[430009.331] [email protected](538982482, 16777216, 1)
[430009.342] [email protected](538982482, 16777216, 2)
[430009.354] [email protected](540422482, 0, 0)
[430009.364] [email protected](540422482, 16777216, 1)
[430009.387] [email protected](540422482, 16777216, 2)
[430009.415] [email protected](943215175, 0, 0)
[430009.427] [email protected](943215175, 16777216, 1)
[430009.440] [email protected](943215175, 16777216, 2)
[430009.464] [email protected](842224199, 0, 0)
[430009.493] [email protected](842224199, 16777216, 1)
[430009.506] [email protected](842224199, 16777216, 2)
[430009.517] [email protected](842224199, 16777216, 4)
[430009.528] [email protected](961959257, 0, 0)
[430009.539] [email protected](961959257, 16777216, 1)
[430009.550] [email protected](961959257, 16777216, 2)
[430009.562] [email protected](825316697, 0, 0)
[430009.574] [email protected](825316697, 16777216, 1)
[430009.586] [email protected](825316697, 16777216, 2)
[430009.598] [email protected](842093913, 0, 0)
[430009.610] [email protected](842093913, 16777216, 1)
[430009.635] [email protected](842093913, 16777216, 2)
[430009.646] [email protected](909202777, 0, 0)
[430009.658] [email protected](909202777, 16777216, 1)
[430009.670] [email protected](909202777, 16777216, 2)
[430009.682] [email protected](875713881, 0, 0)
[430009.694] [email protected](875713881, 16777216, 1)
[430009.704] [email protected](875713881, 16777216, 2)
[430009.716] [email protected](961893977, 0, 0)
[430009.727] [email protected](961893977, 16777216, 1)
[430009.739] [email protected](961893977, 16777216, 2)
[430009.751] [email protected](825316953, 0, 0)
[430009.763] [email protected](825316953, 16777216, 1)
[430009.775] [email protected](825316953, 16777216, 2)
[430009.787] [email protected](842094169, 0, 0)
[430009.799] [email protected](842094169, 16777216, 1)
[430009.811] [email protected](842094169, 16777216, 2)
[430009.823] [email protected](909203033, 0, 0)
[430009.854] [email protected](909203033, 16777216, 1)
[430009.864] [email protected](909203033, 16777216, 2)
[430009.871] [email protected](875714137, 0, 0)
[430009.882] [email protected](875714137, 16777216, 1)
[430009.892] [email protected](875714137, 16777216, 2)
[430009.917] [email protected](842094158, 0, 0)
[430009.929] [email protected](842094158, 16777216, 1)
[430009.942] [email protected](842094158, 16777216, 2)
[430009.953] [email protected](808530000, 0, 0)
[430009.966] [email protected](808530000, 16777216, 1)
[430009.978] [email protected](808530000, 16777216, 2)
[430009.990] [email protected](842084432, 0, 0)
[430010.000] [email protected](842084432, 16777216, 1)
[430010.011] [email protected](842084432, 16777216, 2)
[430010.023] [email protected](909193296, 0, 0)
[430010.035] [email protected](909193296, 16777216, 1)
[430010.048] [email protected](909193296, 16777216, 2)
[430010.058] [email protected](909203022, 0, 0)
[430010.068] [email protected](909203022, 16777216, 1)
[430010.079] [email protected](909203022, 16777216, 2)
[430010.090] [email protected](1448433985, 0, 0)
[430010.103] [email protected](1448433985, 16777216, 1)
[430010.114] [email protected](1448433985, 16777216, 2)
[430010.125] [email protected](1448433985, 16777216, 4)
[430010.137] [email protected](1448434008, 0, 0)
[430010.149] [email protected](1448434008, 16777216, 1)
[430010.160] [email protected](1448434008, 16777216, 2)
[430010.171] [email protected](1448434008, 16777216, 4)
[430010.182] [email protected](1448695129, 0, 0)
[430010.211] [email protected](1448695129, 16777216, 1)
[430010.221] [email protected](1448695129, 16777216, 2)
[430010.230] [email protected](1498831189, 0, 0)
[430010.252] [email protected](1498831189, 16777216, 1)
[430010.282] [email protected](1498831189, 16777216, 2)
[430010.293] [email protected](241)
[430010.299] [email protected]("seat0")
[430010.304] [email protected](3)
[430010.310]  -> [email protected]_pointer(new id wl_pointer@6)
[430010.330]  -> [email protected]_surface(new id wl_surface@3)
[430010.355]  -> [email protected]_keyboard(new id wl_keyboard@14)
[430010.363] [email protected](0, 0, 340, 190, 0, "Unknown", "0xA029", 0)
[430010.385] [email protected](1, 3840, 2160, 60000)
[430010.428] [email protected](2)
[430010.435] [email protected]()
[5217:0312/130033.546314:FATAL:ozone_platform_wayland.cc(171)] Failed to initialize Wayland platform
[1]    5217 trace trap (core dumped)  WAYLAND_DISPLAY=wayland-0 WAYLAND_DEBUG=1 electron -i

I may have missed, but what's is your system specs?

OS: Arch Linux x86_64 
Host: XPS 15 7590 
Kernel: 5.5.8-arch1-1 
Uptime: 35 mins 
Packages: 1222 (pacman) 
Shell: zsh 5.8 
Resolution: 3840x2160 
DE: GNOME 
WM: sway 
Theme: Material-Black-Frost [GTK2/3] 
Icons: Black-Frost-Numix [GTK2/3] 
Terminal: termite 
Terminal Font: MonoLisa 11 
CPU: Intel i7-9750H (12) @ 4.500GHz 
GPU: Intel UHD Graphics 630 
GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q 
Memory: 3492MiB / 31753MiB 

I suppose you use Mesa and your gpu in use is the intel one, right?

Can you please go to ui/ozone/platform/wayland/host/wayland_connection.cc[1] and change this

display_.reset(wl_display_connect(nullptr));

to

display_.reset(wl_display_connect("wayland-0"));
[1] https://cs.chromium.org/chromium/src/ui/ozone/platform/wayland/host/wayland_connection.cc?q=wayland_connection.cc&dr&l=58

and, btw, do you have chromium compile with system libwayland? this can also be a problem.

I am using AUR, so not sure about libwayland. I'm syncing the repo to make the change you suggested.

And yes, I'm running Mesa/Intel since Nvidia only sell inert bricks that do nothing more than add weight to a Linux laptop.

I'm referring to this - https://cs.chromium.org/chromium/src/third_party/wayland/features.gni?type=cs&q=use_system_libwayland&g=0&l=8

If you haven't touched that gn arg, try to set it to true and recompile.

@msisov I have changed both src files as you suggested and recompiled. Unfortunately the result is the same.

I have also built the AUR package electron-ozone and it also fails but with the following:

~ # GDK_BACKEND=x11 electron

[538602:0407/171819.513284:FATAL:ozone_platform_wayland.cc(171)] Failed to initialize Wayland platform
[1]    538602 trace trap (core dumped)  GDK_BACKEND=x11 electron
~ # GDK_BACKEND=wayland electron                                                                                                                                         133

(electron:538765): Gtk-WARNING **: 17:18:40.362: cannot open display: :0



md5-09c493bca06795a5a417eb676256b4ca



'blink_symbol_level=0'
'icu_use_data_file=false'
'is_component_ffmpeg=false'
'link_pulseaudio=true'
'linux_use_bundled_binutils=false'
'treat_warnings_as_errors=false'
'use_custom_libcxx=false'
'use_gnome_keyring=false'
'use_sysroot=false'
'use_ozone=true'
'ozone_auto_platforms=false'
'ozone_platform_wayland=true'
'ozone_platform_x11=true'
'use_xkbcommon=true'
'use_system_libwayland=true'
'use_system_minigbm=true'
'use_system_libdrm=true'
'use_glib=true'

I managed to run Electron under Wayland by rebasing @hedgepigdaniel's patches on top of the 8.2.1 stable release.

It would be nice if @hedgepigdaniel would update the electron-ozone AUR package with these changes (I can submit a pull-request if that helps). Until that happens Arch users can try these changes by using this version of the package (both source and binary packages are available).

Edit: The electron-ozone AUR package has been updated with these changes.

One possible reason why the electron-ozone AUR package was failing for some sway users might have been due to the removal of xdg-shell v6 unstable in sway v1.4 (https://github.com/swaywm/sway/pull/4466) which is what was being used in Electron 7.1.8/Chromium 78 (chromium#997631).

@vially excellent!

I've made https://github.com/hedgepigdaniel/pkgbuild-electron-ozone which is a mirror of the AUR package - you're welcome to submit a PR and I'll publish it.

Package has been updated, thanks @vially

Can confirm that the new build works on sway.

Although it doesn't seem to work with the code-git build of vscode - I get two windows code-git and Code - OSS both of which are blank - but maybe that's an issue with vscode.

Can confirm that the new build works on sway.

Although it doesn't seem to work with the code-git build of vscode - I get two windows code-git and Code - OSS both of which are blank - but maybe that's an issue with vscode.

I don't think VSCode has been updated to work with electron 8: https://github.com/microsoft/vscode/blob/304fc630f7f46db67a33def6b8dd3f8728033546/package.json#L99

Probably its a mistake that the code-git package has not yet been updated to depend on electron7 rather than electron.

I see, I tried a few more apps, like drawio-desktop and they seem to work well with the electron-ozone build.

Any chance of adding the 'rtc_use_pipewire=true' build flag to support Wayland screen sharing?

When not on arch what are the options to get the wayland build?
when will electron ship with ozone?

I don't think VSCode has been updated to work with electron 8

Too bad, that's my real roadblocker for being able to use Wayland. Cannot use it on XWyaland because XWayland scaled applications are super blurry.

I looked at the electron-8 branch and it looks like there isn't anything special about it, they just bumped the electron version: https://github.com/microsoft/vscode/compare/electron-8.0.x

So it looks like vscode is supposed to work with electron 8 (but there may be some bugs, because it's still confined in its own branch).
@nostdm can you please check if it works better on Xorg?

I did try vscode with the electron-ozone build (version 8.2.1 mentioned above) and it does start up but it has some issues that caused it to crash often enough that I had to go back to the X11/XWayland version.

YMMV and I encourage you to try it as it's very straight forward to build. For my build I've just replaced electron7 with electron in this PKGBUILD:

-- _electron=electron7
++ _electron=electron

Most of the crashes that I've seen with vscode were due to some bugs that I've also encountered in chromium-ozone version 80 (most of them related to tooltips). The good news is that most of those crashes are gone now in version 81 of chromium-ozone thanks to the continued work done by the Igalia team.

For me, if version 9 of electron (which will be based on version 82 of chromium: #22932) turns out to be as stable as chromium 81 is on Wayland, that's when I'll be making the switch to run vscode natively on Wayland and ditch XWayland for good. Or that's the plan at least :smiley:

Any chance of adding the 'rtc_use_pipewire=true' build flag to support Wayland screen sharing?

Has been done on the new 8.2.2 version.

Thanks! That's excellent news. I'll give it a test when I get a chance.

Thanks for you works @hedgepigdaniel.
I write a Gentoo ebuild based on your PKGBUILD:
https://github.com/12101111/overlay/blob/master/dev-util/electron/electron-8.2.3.ebuild
It can run under wayland(sway), and crash when vscode is loading (electron-8.0.x branch).
And it can't open in X session:

(electron-8:17347): Gtk-WARNING **: 21:48:29.145: cannot open display: :0

Is ozone_platform_x11 more unstable than ozone_platform_wayland?

@12101111 Ozone/X11 is WIP, so yes, it's still quite unstable. Could you provide more details about your X env? DE/WM and version? I run it daily in in different DEs/WMs with no issues like that.

@nickdiego I'm using Xorg server 1.20.8, mesa 20.0.4, gtk 3.24.18, sway 1.4, awesome wm 4.3.
The ozone build don't run under X or Xwayland

$ GDK_BACKEND=x11 ./electron --no-sandbox

(electron:29446): Gtk-WARNING **: 10:17:14.534: cannot open display: :0
$ GDK_BACKEND=x11 ./electron --no-sandbox --gtk-debug=all --gdk-debug=all
Gtk-Message: 10:16:04.809: Failed to open display (null)
Gtk-Message: 10:16:04.809: Failed to separate connection to default display
Received signal 11 SEGV_MAPERR 000000000018
#0 0x55a48ab79f19 <unknown>
#1 0x55a48aaac243 <unknown>
#2 0x55a48ab79ad2 <unknown>
#3 0x7f23f46be160 <unknown>
#4 0x7f23f3851e80 <unknown>
#5 0x7f23f37259aa gtk_css_value_icon_theme_compute
#6 0x7f23f37483a7 _gtk_css_value_compute
#7 0x7f23f372e2b2 gtk_css_value_initial_compute
#8 0x7f23f37483a7 _gtk_css_value_compute
#9 0x7f23f372e15d gtk_css_value_inherit_compute
#10 0x7f23f37483a7 _gtk_css_value_compute
#11 0x7f23f3741094 gtk_css_static_style_compute_value
#12 0x7f23f372f428 _gtk_css_lookup_resolve
#13 0x7f23f3740ffa gtk_css_static_style_new_compute
#14 0x7f23f3740f5f gtk_css_static_style_get_default
#15 0x7f23f3730a02 gtk_css_node_init
#16 0x7f23f4580fa5 g_type_create_instance
#17 0x7f23f4571de1 g_object_new_internal
#18 0x7f23f4571838 g_object_new_with_properties
#19 0x7f23f45716a3 g_object_new
#20 0x7f23f3748608 gtk_css_widget_node_new
#21 0x7f23f38f1b5f gtk_widget_init
#22 0x7f23f4580fa5 g_type_create_instance
#23 0x7f23f4571de1 g_object_new_internal
#24 0x7f23f4571bf8 g_object_new_valist
#25 0x7f23f4571690 g_object_new
#26 0x7f23f36b3644 gtk_inspector_window_new
#27 0x7f23f390c69b gtk_window_set_debugging
#28 0x7f23f390c66a gtk_window_set_interactive_debugging
#29 0x7f23f37d3f3c gtk_init_check
#30 0x7f23f37d3f46 gtk_init
#31 0x55a48e81e106 <unknown>
#32 0x55a48e814ad2 <unknown>
#33 0x55a48e819e7b <unknown>
#34 0x55a48864637a <unknown>
#35 0x55a48a200beb <unknown>
#36 0x55a48a205068 <unknown>
#37 0x55a48a2003a6 <unknown>
#38 0x55a48a0862a4 <unknown>
#39 0x55a48a085fc3 <unknown>
#40 0x55a48c111201 <unknown>
#41 0x55a4891d0ffe <unknown>
#42 0x55a48858bcc2 <unknown>
#43 0x7f23f00ffe1b __libc_start_main
#44 0x55a48858ba6a _start
  r8: 0000000000000000  r9: 0000000000000065 r10: 0000000000000028 r11: 0000000000000000
 r12: 0000000000000000 r13: 0000213a58f820a0 r14: 0000000000000000 r15: 0000213a58f820a0
  di: 0000000000000000  si: 0000213a58e7b5b0  bp: 0000000000000003  bx: 0000000000000000
  dx: 0000213a58e7b5b0  ax: 0000000000000000  cx: fffffffd52dbbc5e  sp: 00007fff0d0d5038
  ip: 00007f23f3851e80 efl: 0000000000010206 cgf: 002b000000000033 erf: 0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000018
[end of stack trace]
Calling _exit(1). Core file will not be generated.

lldb:

$ GDK_BACKEND=x11 lldb ./electron
(lldb) target create "./electron"
Current executable set to '/tmp/electron-ozone/usr/lib64/electron-8/electron' (x86_64).
(lldb) r --no-sandbox --gtk-debug=all --gdk-debug=all
Process 26504 launched: '/tmp/electron-ozone/usr/lib64/electron-8/electron' (x86_64)
Gtk-Message: 10:12:06.866: Failed to open display (null)
Gtk-Message: 10:12:06.866: Failed to separate connection to default display
Process 26504 stopped
* thread #1, name = 'electron', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
    frame #0: 0x00007ffff711ce80 libgtk-3.so.0`_gtk_settings_get_screen(settings=0x0000000000000000) at gtksettings.c:3348:20
(lldb) bt
* thread #1, name = 'electron', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
  * frame #0: 0x00007ffff711ce80 libgtk-3.so.0`_gtk_settings_get_screen(settings=0x0000000000000000) at gtksettings.c:3348:20
    frame #1: 0x00007ffff6ff09aa libgtk-3.so.0`gtk_css_value_icon_theme_compute(icon_theme=<unavailable>, property_id=<unavailable>, provider=<unavailable>, style=<unavailable>, parent_style=<unavailable>) at gtkcssiconthemevalue.c:84:48
    frame #2: 0x00007ffff70133a7 libgtk-3.so.0`_gtk_css_value_compute(value=<unavailable>, property_id=<unavailable>, provider=<unavailable>, style=<unavailable>, parent_style=<unavailable>) at gtkcssvalue.c:97:10
    frame #3: 0x00007ffff6ff92b2 libgtk-3.so.0`gtk_css_value_initial_compute(value=<unavailable>, property_id=3, provider=0x0000000000000000, style=0x000010d49974c0a0, parent_style=0x0000000000000000) at gtkcssinitialvalue.c:73:10
    frame #4: 0x00007ffff70133a7 libgtk-3.so.0`_gtk_css_value_compute(value=<unavailable>, property_id=<unavailable>, provider=<unavailable>, style=<unavailable>, parent_style=<unavailable>) at gtkcssvalue.c:97:10
    frame #5: 0x00007ffff6ff915d libgtk-3.so.0`gtk_css_value_inherit_compute(value=<unavailable>, property_id=3, provider=<unavailable>, style=<unavailable>, parent_style=<unavailable>) at gtkcssinheritvalue.c:49:14
    frame #6: 0x00007ffff70133a7 libgtk-3.so.0`_gtk_css_value_compute(value=<unavailable>, property_id=<unavailable>, provider=<unavailable>, style=<unavailable>, parent_style=<unavailable>) at gtkcssvalue.c:97:10
    frame #7: 0x00007ffff700c094 libgtk-3.so.0`gtk_css_static_style_compute_value(style=0x000010d49974c0a0, provider=0x0000000000000000, parent_style=0x0000000000000000, id=3, specified=0x00007ffff722c230, section=0x0000000000000000) at gtkcssstaticstyle.c:237:11
    frame #8: 0x00007ffff6ffa428 libgtk-3.so.0`_gtk_css_lookup_resolve(lookup=0x000010d4995ffe00, provider=0x0000000000000000, style=0x000010d49974c0a0, parent_style=0x0000000000000000) at gtkcsslookup.c:122:9
    frame #9: 0x00007ffff700bffa libgtk-3.so.0`gtk_css_static_style_new_compute(provider=0x0000000000000000, matcher=<unavailable>, parent=0x0000000000000000) at gtkcssstaticstyle.c:195:3
    frame #10: 0x00007ffff700bf5f libgtk-3.so.0`gtk_css_static_style_get_default at gtkcssstaticstyle.c:164:23
    frame #11: 0x00007ffff6ffba02 libgtk-3.so.0`gtk_css_node_init(cssnode=0x000010d49973d1b0) at gtkcssnode.c:667:34
    frame #12: 0x00007ffff7e4bfa5 libgobject-2.0.so.0`g_type_create_instance(type=<unavailable>) at gtype.c:1861:4
    frame #13: 0x00007ffff7e3cde1 libgobject-2.0.so.0`g_object_new_internal(class=0x000010d4995e3960, params=0x0000000000000000, n_params=0) at gobject.c:1937:24
    frame #14: 0x00007ffff7e3c838 libgobject-2.0.so.0`g_object_new_with_properties(object_type=18505292407456, n_properties=0, names=0x0000000000000000, values=0x0000000000000000) at gobject.c:2105:14
    frame #15: 0x00007ffff7e3c6a3 libgobject-2.0.so.0`g_object_new(object_type=<unavailable>, first_property_name=<unavailable>) at gobject.c:1777:12
    frame #16: 0x00007ffff7013608 libgtk-3.so.0`gtk_css_widget_node_new(widget=0x000010d499748480) at gtkcsswidgetnode.c:297:12
    frame #17: 0x00007ffff71bcb5f libgtk-3.so.0`gtk_widget_init(instance=0x000010d499748480, g_class=0x000010d4995e1200) at gtkwidget.c:4468:19
    frame #18: 0x00007ffff7e4bfa5 libgobject-2.0.so.0`g_type_create_instance(type=<unavailable>) at gtype.c:1861:4
    frame #19: 0x00007ffff7e3cde1 libgobject-2.0.so.0`g_object_new_internal(class=0x000010d4995e1200, params=0x00007fffffffcbe0, n_params=1) at gobject.c:1937:24
    frame #20: 0x00007ffff7e3cbf8 libgobject-2.0.so.0`g_object_new_valist(object_type=<unavailable>, first_property_name=<unavailable>, var_args=<unavailable>) at gobject.c:2262:16
    frame #21: 0x00007ffff7e3c690 libgobject-2.0.so.0`g_object_new(object_type=<unavailable>, first_property_name=<unavailable>) at gobject.c:1780:12
    frame #22: 0x00007ffff6f7e644 libgtk-3.so.0`gtk_inspector_window_new at window.c:321:10
    frame #23: 0x00007ffff71d769b libgtk-3.so.0`gtk_window_set_debugging(enable=1, select=0, warn=0) at gtkwindow.c:12767:26
    frame #24: 0x00007ffff71d766a libgtk-3.so.0`gtk_window_set_interactive_debugging(enable=<unavailable>) at gtkwindow.c:12830:3
    frame #25: 0x00007ffff709ef3c libgtk-3.so.0`gtk_init_check(argc=<unavailable>, argv=<unavailable>) at gtkmain.c:1112:5
    frame #26: 0x00007ffff709ef46 libgtk-3.so.0`gtk_init(argc=<unavailable>, argv=<unavailable>) at gtkmain.c:1166:8
    frame #27: 0x000055555e380106 electron`___lldb_unnamed_symbol405691$$electron + 150
    frame #28: 0x000055555e376ad2 electron`___lldb_unnamed_symbol405583$$electron + 866
    frame #29: 0x000055555e37be7b electron`___lldb_unnamed_symbol405643$$electron + 27
    frame #30: 0x00005555581a837a electron`___lldb_unnamed_symbol4472$$electron + 106
    frame #31: 0x0000555559d62beb electron`___lldb_unnamed_symbol95227$$electron + 187
    frame #32: 0x0000555559d67068 electron`___lldb_unnamed_symbol95278$$electron + 648
    frame #33: 0x0000555559d623a6 electron`___lldb_unnamed_symbol95219$$electron + 182
    frame #34: 0x0000555559be82a4 electron`___lldb_unnamed_symbol89107$$electron + 692
    frame #35: 0x0000555559be7fc3 electron`___lldb_unnamed_symbol89106$$electron + 323
    frame #36: 0x000055555bc73201 electron`___lldb_unnamed_symbol226506$$electron + 3761
    frame #37: 0x0000555558d32ffe electron`___lldb_unnamed_symbol54351$$electron + 142
    frame #38: 0x00005555580edcc2 electron`___lldb_unnamed_symbol3$$electron + 450
    frame #39: 0x00007ffff39cae1b libc.so.6`__libc_start_main + 235
    frame #40: 0x00005555580eda6a electron`_start + 42

I've never hit that specific error. Are you able to run Chromium ozone/x11 on your env? As it's under heavy development, it'd be interesting to check the most recent versions. If yes, it might be something electron specific in gtk/ozone initialization. I'd also look at the issues/fixes reported by other users some comments above :point_up:. Some of them observed a stability boost in most recent versions.

_As a shot in the dark, it might be related to this issue, which in my env used to cause crashes only when trying to open gtk dialogs, not at startup._

@nickdiego I suppose it's because they use the stable channel, which in their case is ""80.0.3987.163"". It's not reliable in case of Ozone/X11/Wayland as there are changes constantly going to the trunk.

I try to build chromium-83.0.4103.15, it works on wayland, and I need chromium --ozone-platform=x11 to run on X.
But electron can't launch on X:

$ ./electron --ozone-platform=x11

Electron 8.2.3 - Build cross platform desktop apps with JavaScript, HTML, and CSS
Usage: electron [options] [path]

A path to an Electron app may be specified. It must be one of the following:
  - index.js file.
  - Folder containing a package.json file.
  - Folder containing an index.js file.
  - .html/.htm file.
  - http://, https://, or file:// URL.

Options:
  -i, --interactive     Open a REPL to the main process.
  -r, --require         Module to preload (option can be repeated).
  -v, --version         Print the version.
  -a, --abi             Print the Node ABI version.
Received signal 11 SEGV_MAPERR 000000000000
#0 0x55b9f7eadf19 <unknown>
#1 0x55b9f7de0243 <unknown>
#2 0x55b9f7eadad2 <unknown>
#3 0x7fa643ba4160 <unknown>
#4 0x55b9f898ad06 <unknown>
#5 0x55b9f609f3a8 <unknown>
#6 0x55b9f91f07de <unknown>
#7 0x55b9f8dc5f09 <unknown>
#8 0x55b9fae0172b <unknown>
#9 0x55b9fae33d70 <unknown>
#10 0x55b9fae3211f <unknown>
#11 0x55b9fadfd418 <unknown>
#12 0x55b9f599a0c0 <unknown>
#13 0x55b9f599c0bb <unknown>
#14 0x55b9f592558b <unknown>
#15 0x55b9f58dffc9 <unknown>
#16 0x55b9f58e1b63 <unknown>
#17 0x55b9f58dd422 <unknown>
#18 0x55b9f58dd166 <unknown>
#19 0x55b9f58dd313 <unknown>
#20 0x55b9f6706782 <unknown>
#21 0x55b9f670589e <unknown>
#22 0x55b9f670513e <unknown>
#23 0x55b9f711dbf9 <unknown>
  r8: 0000000000000000  r9: 000000000606ece8 r10: 0000000000000018 r11: 002fc8b7156f8000
 r12: 00001497d4b9b180 r13: 00001497d4dfea80 r14: 00001497d515f510 r15: 00007fff79d10f80
  di: 00001497d531c634  si: 0000000000000001  bp: 00007fff79d10f10  bx: 00001497d515f480
  dx: 0000000000000010  ax: 0000000000000000  cx: 000055b9fc042fc8  sp: 00007fff79d10ef0
  ip: 000055b9f898ad06 efl: 0000000000010202 cgf: 002b000000000033 erf: 0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

@msisov Yeah, it makes sense.

I try to build chromium-83.0.4103.15, it works on wayland, and I need chromium --ozone-platform=x11 to run on X.
But electron can't launch on X:

So, there seems be some electron-specific issue in Gtk/Ozone initialization. Could anybody confirm this issue in other setups? Sorry but I currently don't have time to look into it (don't even have a local electron build).

Do I need to change ozone_auto_platforms to true?

Currently ozone_auto_platforms just sets x11 as default backend, as we still don't have platform auto-detection on Linux desktop.

I build electron 8.2.3 with CXXFLAGS=-O1 -g, and get a backtrace with source code:

$ lldb ./electron
(lldb) target create "./electron"
Current executable set to '/data/tmp/portage/dev-util/electron-8.2.3/image/usr/lib/electron-8/electron' (x86_64).
(lldb) r --ozone-platform=x11
Process 823 launched: '/data/tmp/portage/dev-util/electron-8.2.3/image/usr/lib/electron-8/electron' (x86_64)
Process 823 stopped and restarted: thread 1 received signal: SIGCHLD

Electron 8.2.3 - Build cross platform desktop apps with JavaScript, HTML, and CSS
Usage: electron [options] [path]

A path to an Electron app may be specified. It must be one of the following:
  - index.js file.
  - Folder containing a package.json file.
  - Folder containing an index.js file.
  - .html/.htm file.
  - http://, https://, or file:// URL.

Options:
  -i, --interactive     Open a REPL to the main process.
  -r, --require         Module to preload (option can be repeated).
  -v, --version         Print the version.
  -a, --abi             Print the Node ABI version.
Process 823 stopped
* thread #1, name = 'electron', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x00005555636e2a11 electron`ui::InputMethodAuraLinux::InputMethodAuraLinux(this=0x000055556836a480, delegate=<unavailable>) at input_method_auralinux.cc:35:51
   32         << "Trying to initialize InputMethodAuraLinux, but "
   33            "LinuxInputMethodContextFactory is not initialized yet.";
   34     context_ =
-> 35         LinuxInputMethodContextFactory::instance()->CreateInputMethodContext(
   36             this, false);
   37     context_simple_ =
   38         LinuxInputMethodContextFactory::instance()->CreateInputMethodContext(
(lldb) bt
* thread #1, name = 'electron', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x00005555636e2a11 electron`ui::InputMethodAuraLinux::InputMethodAuraLinux(this=0x000055556836a480, delegate=<unavailable>) at input_method_auralinux.cc:35:51
    frame #1: 0x000055555e778750 electron`std::__1::__unique_if<ui::InputMethodAuraLinux>::__unique_single std::__1::make_unique<ui::InputMethodAuraLinux, ui::internal::InputMethodDelegate*&>(__args=<unavailable>) at memory:3028:32
    frame #2: 0x000055555e79d9b2 electron`ui::(anonymous namespace)::OzonePlatformX11::CreateInputMethod(this=<unavailable>, delegate=0x0000555568501020) at ozone_platform_x11.cc:115:12
    frame #3: 0x0000555564241a20 electron`ui::CreateInputMethod(delegate=<unavailable>, widget=<unavailable>) at input_method_factory.cc:69:44
    frame #4: 0x0000555563be4da2 electron`aura::WindowTreeHost::GetInputMethod(this=0x0000555568501020) at window_tree_host.cc:276:9
    frame #5: 0x00005555665a0f53 electron`views::DesktopNativeWidgetAura::GetInputMethod(this=0x0000555568507240) at desktop_native_widget_aura.cc:693:27
    frame #6: 0x0000555566558db6 electron`views::Widget::GetInputMethod(this=0x0000555568369c80) at widget.cc:814:37
    frame #7: 0x000055556655a26b electron`views::Widget::OnNativeWidgetSizeChanged(this=0x0000555568369c80, new_size=0x00007fffffffb4a8) at widget.cc:1202:28
    frame #8: 0x00005555665a2343 electron`views::DesktopNativeWidgetAura::OnHostResized(this=<unavailable>, host=<unavailable>) at desktop_native_widget_aura.cc:1250:28
    frame #9: 0x00005555665a0858 electron`views::DesktopNativeWidgetAura::InitNativeWidget(this=0x0000555568507240, params=InitParams @ 0x00007fffffffb540) at desktop_native_widget_aura.cc:552:3
    frame #10: 0x000055556655766a electron`views::Widget::Init(this=0x0000555568369c80, params=InitParams @ 0x00007fffffffb958) at widget.cc:353:19
    frame #11: 0x000055555dc7f316 electron`electron::NativeWindowViews::NativeWindowViews(this=0x000055556843ae20, options=<unavailable>, parent=<unavailable>) at native_window_views.cc:206:13
    frame #12: 0x000055555dc8116b electron`electron::NativeWindow::Create(options=<unavailable>, parent=<unavailable>) at native_window_views.cc:1484:14
    frame #13: 0x000055555db98cb7 electron`electron::api::TopLevelWindow::TopLevelWindow(this=<unavailable>, isolate=0x00005555687a28c0, options=0x00007fffffffbde0) at electron_api_top_level_window.cc:96:17
    frame #14: 0x000055555db11647 electron`electron::api::BrowserWindow::BrowserWindow(this=0x00005555685f32a0, args=0x00007fffffffbf20, options=0x00007fffffffbde0) at electron_api_browser_window.cc:34:7
    frame #15: 0x000055555db12e32 electron`electron::api::BrowserWindow::New(thrower=<unavailable>, args=0x00007fffffffbf20) at electron_api_browser_window.cc:464:14
    frame #16: 0x000055555db09d7c electron`mate::WrappableBase* base::internal::FunctorTraits<mate::WrappableBase* (*)(gin_helper::ErrorThrower, gin::Arguments*), void>::Invoke<mate::WrappableBase* (function=<unavailable>, args=<unavailable>, args=<unavailable>)(gin_helper::ErrorThrower, gin::Arguments*), gin_helper::ErrorThrower, gin::Arguments*>(mate::WrappableBase* (* const&)(gin_helper::ErrorThrower, gin::Arguments*), gin_helper::ErrorThrower&&, gin::Arguments*&&) at bind_internal.h:398:12
    frame #17: 0x000055555db09d19 electron`mate::WrappableBase* base::internal::InvokeHelper<false, mate::WrappableBase*>::MakeItSo<mate::WrappableBase* (functor=<unavailable>, args=<unavailable>, args=<unavailable>)(gin_helper::ErrorThrower, gin::Arguments*), gin_helper::ErrorThrower, gin::Arguments*>(mate::WrappableBase* (* const&)(gin_helper::ErrorThrower, gin::Arguments*), gin_helper::ErrorThrower&&, gin::Arguments*&&) at bind_internal.h:598:12
    frame #18: 0x000055555db09cc9 electron`mate::WrappableBase* base::internal::Invoker<base::internal::BindState<mate::WrappableBase* (*)(gin_helper::ErrorThrower, gin::Arguments*)>, mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)>::RunImpl<mate::WrappableBase* (functor=<unavailable>, bound=<unavailable>, (null)=<unavailable>, unbound_args=<unavailable>, unbound_args=<unavailable>)(gin_helper::ErrorThrower, gin::Arguments*), std::__1::tuple<> const&>(mate::WrappableBase* (* const&)(gin_helper::ErrorThrower, gin::Arguments*), std::__1::tuple<> const&, std::__1::integer_sequence<unsigned long>, gin_helper::ErrorThrower&&, gin::Arguments*&&) at bind_internal.h:671:12
    frame #19: 0x000055555db09c7b electron`base::internal::Invoker<base::internal::BindState<mate::WrappableBase* (*)(gin_helper::ErrorThrower, gin::Arguments*)>, mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)>::Run(base=<unavailable>, unbound_args=<unavailable>, unbound_args=0x00007fffffffbf20) at bind_internal.h:653:12
    frame #20: 0x000055555db09b5c electron`base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)>::Run(this=<unavailable>, args=<unavailable>, args=0x00007fffffffbf20) const & at callback.h:132:12
    frame #21: 0x000055555db09a77 electron`mate::WrappableBase* mate::internal::InvokeFactory<gin_helper::ErrorThrower, gin::Arguments*>(args=<unavailable>, callback=0x000055556829ba68)> const&) at constructor.h:50:19
    frame #22: 0x000055555db09145 electron`void mate::internal::InvokeNew<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)>(factory=0x000055556829ba68, isolate=0x00005555687a28c0, args=0x00007fffffffc1c0)> const&, v8::Isolate*, mate::Arguments*) at constructor.h:143:14
    frame #23: 0x000055555db09829 electron`void base::internal::FunctorTraits<void (*)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), void>::Invoke<void (function=<unavailable>, args=<unavailable>, args=<unavailable>, args=<unavailable>)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*>(void (* const&)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*&&, mate::Arguments*&&) at bind_internal.h:398:12
    frame #24: 0x000055555db0977e electron`void base::internal::InvokeHelper<false, void>::MakeItSo<void (functor=<unavailable>, args=<unavailable>, args=<unavailable>, args=<unavailable>)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*>(void (* const&)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*&&, mate::Arguments*&&) at bind_internal.h:598:12
    frame #25: 0x000055555db0971e electron`void base::internal::Invoker<base::internal::BindState<void (*)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> >, void (v8::Isolate*, mate::Arguments*)>::RunImpl<void (functor=<unavailable>, bound=<unavailable>, (null)=<unavailable>, unbound_args=<unavailable>, unbound_args=<unavailable>)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), std::__1::tuple<base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> > const&, 0ul>(void (* const&)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), std::__1::tuple<base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> > const&, std::__1::integer_sequence<unsigned long, 0ul>, v8::Isolate*&&, mate::Arguments*&&) at bind_internal.h:671:12
    frame #26: 0x000055555db096b3 electron`base::internal::Invoker<base::internal::BindState<void (*)(base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> const&, v8::Isolate*, mate::Arguments*), base::RepeatingCallback<mate::WrappableBase* (gin_helper::ErrorThrower, gin::Arguments*)> >, void (v8::Isolate*, mate::Arguments*)>::Run(base=<unavailable>, unbound_args=0x00005555687a28c0, unbound_args=0x00007fffffffc1c0) at bind_internal.h:653:12
    frame #27: 0x000055555db0951c electron`base::RepeatingCallback<void (v8::Isolate*, mate::Arguments*)>::Run(this=<unavailable>, args=0x00005555687a28c0, args=0x00007fffffffc1c0) const & at callback.h:132:12
    frame #28: 0x000055555db0944c electron`mate::internal::Invoker<mate::internal::IndicesHolder<0ul, 1ul>, v8::Isolate*, mate::Arguments*>::DispatchToCallback(this=<unavailable>, callback=<unavailable>)>) at function_template.h:209:14
    frame #29: 0x000055555db092d8 electron`mate::internal::Dispatcher<void (v8::Isolate*, mate::Arguments*)>::DispatchToCallback(info=<unavailable>) at function_template.h:243:15
    frame #30: 0x000055555f8d3095 electron`v8::internal::FunctionCallbackArguments::Call(this=0x00007fffffffc3c0, handler=CallHandlerInfo @ 0x00007fffffffc270) at api-arguments-inl.h:158:3
    frame #31: 0x000055555f8d19e3 electron`v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(isolate=<unavailable>, function=<unavailable>, new_target=<unavailable>, fun_data=<unavailable>, receiver=<unavailable>, args=BuiltinArguments @ 0x00007fffffffc490) at builtins-api.cc:111:36
    frame #32: 0x000055555f8d0d58 electron`v8::internal::Builtin_Impl_HandleApiCall(args=BuiltinArguments @ 0x00007fffffffc4d0, isolate=0x00005555687a28c0) at builtins-api.cc:137:5
    frame #33: 0x000055555f8d09a9 electron`v8::internal::Builtin_HandleApiCall(args_length=6, args_object=0x00007fffffffc5d0, isolate=0x00005555687a28c0) at builtins-api.cc:129:1
    frame #34: 0x00005555605fbf39 electron`Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
    frame #35: 0x00005555605876a1 electron`Builtins_JSBuiltinsConstructStub + 97
    frame #36: 0x0000555560673fdb electron`Builtins_ConstructHandler + 187
    frame #37: 0x000055556058b9d8 electron`Builtins_InterpreterEntryTrampoline + 184
    frame #38: 0x00005555605b9b10 electron`Builtins_AsyncFunctionAwaitResolveClosure + 48
    frame #39: 0x00005555605db2f2 electron`Builtins_PromiseFulfillReactionJob + 50
    frame #40: 0x00005555605ab888 electron`Builtins_RunMicrotasks + 552
    frame #41: 0x0000555560589238 electron`Builtins_JSRunMicrotasksEntry + 120
    frame #42: 0x000055555f9f0200 electron`v8::internal::GeneratedCode<unsigned long, unsigned long, v8::internal::MicrotaskQueue*>::Call(this=<unavailable>, args=<unavailable>, args=<unavailable>) at simulator.h:142:12
    frame #43: 0x000055555f9eef4d electron`v8::internal::(anonymous namespace)::Invoke(isolate=0x00005555687a28c0, params=0x00007fffffffca18)::InvokeParams const&) at execution.cc:281:33
    frame #44: 0x000055555f9ef895 electron`v8::internal::(anonymous namespace)::InvokeWithTryCatch(isolate=0x00005555687a28c0, params=0x00007fffffffca18)::InvokeParams const&) at execution.cc:326:20
    frame #45: 0x000055555f9efa6e electron`v8::internal::Execution::TryRunMicrotasks(isolate=0x00005555687a28c0, microtask_queue=<unavailable>, exception_out=<unavailable>) at execution.cc:405:10
    frame #46: 0x000055555fa25acf electron`v8::internal::MicrotaskQueue::RunMicrotasks(this=0x0000555568435180, isolate=0x00005555687a28c0) at microtask-queue.cc:164:22
    frame #47: 0x000055555fa25839 electron`v8::internal::MicrotaskQueue::PerformCheckpoint(this=0x0000555568435180, v8_isolate=0x00005555687a28c0) at microtask-queue.cc:117:5
    frame #48: 0x000055555f862819 electron`v8::MicrotasksScope::PerformCheckpoint(v8_isolate=0x00005555687a28c0) at api.cc:9202:20
    frame #49: 0x000055555dc7a645 electron`electron::MicrotasksRunner::DidProcessTask(this=0x00005555682dbde0, pending_task=<unavailable>) at microtasks_runner.cc:18:3
    frame #50: 0x00005555627ca874 electron`base::sequence_manager::internal::SequenceManagerImpl::NotifyDidProcessTask(this=<unavailable>, executing_task=0x00007fffef864360, time_after_task=<unavailable>) at sequence_manager_impl.cc:867:16
    frame #51: 0x00005555627ca4ab electron`base::sequence_manager::internal::SequenceManagerImpl::DidRunTask(this=0x000055556803cde0) at sequence_manager_impl.cc:678:3
    frame #52: 0x00005555627e576e electron`base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(this=<unavailable>, continuation_lazy_now=0x00007fffffffce60, ran_task=0x00007fffffffceaf) at thread_controller_with_message_pump_impl.cc:378:37
    frame #53: 0x00005555627e5436 electron`base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork(this=0x00007fffef85d9e0) at thread_controller_with_message_pump_impl.cc:219:7
    frame #54: 0x00005555627560c7 electron`base::MessagePumpGlib::Run(this=0x00007ffff1e89f20, delegate=<unavailable>) at message_pump_glib.cc:441:48
    frame #55: 0x00005555627e5e31 electron`base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(this=0x00007fffef85d9e0, application_tasks_allowed=true, timeout=(delta_ = 9223372036854775807)) at thread_controller_with_message_pump_impl.cc:463:12
    frame #56: 0x00005555627944c0 electron`base::RunLoop::Run(this=0x00007fffffffd060) at run_loop.cc:156:14
    frame #57: 0x0000555560c83a78 electron`content::BrowserMainLoop::MainMessageLoopRun(this=<unavailable>) at browser_main_loop.cc:1535:12
    frame #58: 0x0000555560c838b8 electron`content::BrowserMainLoop::RunMainMessageLoopParts(this=0x00005555680e2360) at browser_main_loop.cc:1062:5
    frame #59: 0x0000555560c8babd electron`content::BrowserMainRunnerImpl::Run(this=<unavailable>) at browser_main_runner_impl.cc:150:15
    frame #60: 0x0000555560c80f42 electron`content::BrowserMain(parameters=<unavailable>) at browser_main.cc:47:28
    frame #61: 0x00005555609b97db electron`content::RunBrowserProcessMain(main_function_params=0x00007fffffffd2e0, delegate=<unavailable>) at content_main_runner_impl.cc:527:10
    frame #62: 0x00005555609ba399 electron`content::ContentMainRunnerImpl::RunServiceManager(this=0x00007fffef922160, main_params=<unavailable>, start_service_manager_only=<unavailable>) at content_main_runner_impl.cc:960:10
    frame #63: 0x00005555609ba0db electron`content::ContentMainRunnerImpl::Run(this=0x00007fffef922160, start_service_manager_only=false) at content_main_runner_impl.cc:868:12
    frame #64: 0x000055555f24461f electron`content::ContentServiceManagerMainDelegate::RunEmbedderProcess(this=0x00007fffffffd5c0) at content_service_manager_main_delegate.cc:52:32
    frame #65: 0x00005555645ce0f3 electron`service_manager::Main(params=<unavailable>) at main.cc:423:29
    frame #66: 0x000055555f2469be electron`content::ContentMain(params=0x00007fffffffd660) at content_main.cc:19:10
    frame #67: 0x000055555dac9ffa electron`main(argc=2, argv=0x00007fffffffd768) at electron_main.cc:189:10

I think https://github.com/chromium/chromium/commit/182d586fee5b5f9053b5702fcfc847f18ea5ec79 will fix this and I will try to backport this fix to chromium 80
Edit: there is another crash after apply this patch

$ lldb ./electron
(lldb) target create "./electron"
Current executable set to '/data/tmp/portage/dev-util/electron-8.2.3/image/usr/lib/electron-8/electron' (x86_64).
(lldb) r --ozone-platform=x11
Process 15986 launched: '/data/tmp/portage/dev-util/electron-8.2.3/image/usr/lib/electron-8/electron' (x86_64)
Process 15986 stopped and restarted: thread 1 received signal: SIGCHLD

Electron 8.2.3 - Build cross platform desktop apps with JavaScript, HTML, and CSS
Usage: electron [options] [path]

A path to an Electron app may be specified. It must be one of the following:
  - index.js file.
  - Folder containing a package.json file.
  - Folder containing an index.js file.
  - .html/.htm file.
  - http://, https://, or file:// URL.

Options:
  -i, --interactive     Open a REPL to the main process.
  -r, --require         Module to preload (option can be repeated).
  -v, --version         Print the version.
  -a, --abi             Print the Node ABI version.
Process 15986 stopped
* thread #1, name = 'electron', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x00005555665a03f4 electron`views::DesktopNativeWidgetAura::HandleActivationChanged(this=0x00005555683a9840, active=true) at desktop_native_widget_aura.cc:417:25
   414            view_for_activation->GetWidget()->GetNativeView());
   415        // Refreshes the focus info to IMF in case that IMF cached the old info
   416        // about focused text input client when it was "inactive".
-> 417        GetInputMethod()->OnFocus();
   418      }
   419    } else {
   420      // TODO(nektar): We need to harmonize the firing of accessibility
(lldb) bt
* thread #1, name = 'electron', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x00005555665a03f4 electron`views::DesktopNativeWidgetAura::HandleActivationChanged(this=0x00005555683a9840, active=true) at desktop_native_widget_aura.cc:417:25
    frame #1: 0x00005555665b82f5 electron`views::DesktopWindowTreeHostPlatform::OnActivationChanged(this=0x000055556834c400, active=<unavailable>) at desktop_window_tree_host_platform.cc:688:32
    frame #2: 0x00005555665abbd2 electron`views::DesktopWindowTreeHostLinux::OnActivationChanged(this=0x000055556834c400, active=true) at desktop_window_tree_host_linux.cc:291:34
    frame #3: 0x00005555636f2301 electron`ui::X11Window::OnXWindowIsActiveChanged(this=<unavailable>, active=<unavailable>) at x11_window.cc:607:30
    frame #4: 0x000055556353e8c6 electron`ui::XWindow::AfterActivationStateChanged(this=0x0000555568789e28) at x11_window.cc:923:5
    frame #5: 0x000055556353fa94 electron`ui::XWindow::OnFocusEvent(this=0x0000555568789e28, focus_in=<unavailable>, mode=<unavailable>, detail=3) at x11_window.cc:1040:3
    frame #6: 0x000055556353fc3c electron`ui::XWindow::ProcessEvent(this=0x0000555568789e28, xev=0x00007fffffffccc0) at x11_window.cc:1145:7
    frame #7: 0x000055555e7a8b98 electron`ui::X11WindowOzone::DispatchXEvent(this=<unavailable>, xev=0x00007fffffffccc0) at x11_window_ozone.cc:66:12
    frame #8: 0x00005555635c8ad3 electron`ui::X11EventSourceDefault::DispatchXEventToXEventDispatchers(this=0x00005555683a5c40, xevent=0x00007fffffffccc0) at x11_event_source_default.cc:136:22
    frame #9: 0x00005555635c8772 electron`ui::X11EventSourceDefault::ProcessXEvent(this=0x00005555683a5c40, xevent=0x00007fffffffccc0) at x11_event_source_default.cc:90:5
    frame #10: 0x00005555635c226c electron`ui::X11EventSource::ExtractCookieDataDispatchEvent(this=0x00005555683a5cc8, xevent=0x00007fffffffccc0) at x11_event_source.cc:273:14
    frame #11: 0x00005555635c2211 electron`ui::X11EventSource::DispatchXEvents(this=0x00005555683a5cc8) at x11_event_source.cc:140:5
    frame #12: 0x00005555635c8c70 electron`ui::X11EventSourceDefault::OnFileCanReadWithoutBlocking(this=<unavailable>, fd=<unavailable>) at x11_event_source_default.cc:165:17
    frame #13: 0x0000555562755f92 electron`base::MessagePumpGlib::FdWatchController::NotifyCanRead(this=<unavailable>) at message_pump_glib.cc:333:13
    frame #14: 0x000055556275634f electron`base::MessagePumpGlib::HandleFdWatchDispatch(this=<unavailable>, controller=0x00005555683a5d50) at message_pump_glib.cc:502:17
    frame #15: 0x00005555627564bd electron`base::(anonymous namespace)::FdWatchSourceDispatch(gsource=<unavailable>, unused_func=<unavailable>, unused_data=<unavailable>)(void*), void*) at message_pump_glib.cc:194:17
    frame #16: 0x00007ffff7e4d585

Does anybody know how to compile electron to support wayland native? (step by step) And run electron apps in wayland(weston etc...).
It took hours to compile electron and i fail many times.

@caijw, you may not be an arch user, but you might look at the PKGBUILD for electron-ozone for clues on building it. My understanding is that it is still very experimental.

vscode will skip electron 8 and use electron 9 in the next version, which is based on chromium 83 and works very stably with ozone-wayland and ozone-x11. But electron 9 still need some patches to compile with ozone

Chromium built-in ozone flags is on the way coming https://bugs.chromium.org/p/chromium/issues/detail?id=1085700

Here is my WIP attempt to rebase my wayland branch of electron on v9.x.x: https://github.com/electron/electron/compare/9-x-y...hedgepigdaniel:arch-9?expand=1

Currently its good enough to run electron-quick-start, but not much else. Most often the symptom is that windows don't appear.

I've also updated https://aur.archlinux.org/packages/electron-ozone/

I'd welcome help if anyone can work out whats wrong - feel free to make a PR to my fork. Also feel free to take my patches and turn them into something polished/mergeable - I don't really have time to do it all myself.

Thanks for you patches @hedgepigdaniel.
I have compiled it and found some issue:

  1. Can't close window ( which is mentioned in AUR )
  2. run electron-9 --ozone-platform=wayland but the window don't appear. electron-9 --ozone-platform=x11 works without probem
  3. vscode need environment variable ELECTRON_RUN_AS_NODE=1 to launch, but ELECTRON_RUN_AS_NODE=1 electron-9 --ozone-platform=x11 got a error: electron-9: bad option: --ozone-platform=x11
  4. Drag and drop don't work (for example: file explorer or tabs in vscode)

图片

I did some more testing using the arch packages,

It works, without any empty windows or anything. The main issue I've found is that if you scroll using a mouse wheel inside the application menus, all windows disappear. I think this bug has been fixed in more recent chromium versions.

@hedgepigdaniel I think your patches on Electron are totally fine to be included in upstream, are you interested in creating a PR to merge the changes to master branch?

Does anyone have Ubuntu buildfiles? I am open to helping fix Wayland bugs :)
Does someone know btw. which component broke the drag and drop support? Chromium, ozone, electron or vscode?

@hedgepigdaniel what's the issue with closing windows and menus? anything I could start from if I wanted to work on a fix?

@ninja- Drag and drop does not work on Chromium on Linux, so I don't think it's a electron or vscode bug.

@ninja- Drag and drop does not work on Chromium on Linux, so I don't think it's a electron or vscode bug.

@WhyNotHugo Which version (or head commit) of Chromium Ozone/Wayland are you using? I have a fresh build of trunk and DnD works quite well.

I'm using Chromium 85.0.4183.83, but not the Ozone version. I don't have the resources to build the Ozone version from source.

@WhyNotHugo we have good news for you :) Ozone is built by default for Chromium now (merged the patch for the 3rd time today 🤣 ). Soon, it should become part of dev chrome releases as well.

https://chromium-review.googlesource.com/c/chromium/src/+/2382834

Though, the patch may be reverted again. we need to wait a couple of days until it sticks.

I tried building chromium with ozone from scratch a month ago and it was a total mess :/ couldn't get it to compile

@nickdiego was window closing issue fixed as well?

@ninja- I’m very surprised and sorry at the same time that you couldn’t compile ozone. However, we, the developers, do that every day without any issues.

What kind of guidelines did you use? Did you compile ozone from the upstream? Or did you use some third party recipes? Please note that we are not responsible for those and they are under maintenance of downstream projects.

I'm using Chromium 85.0.4183.83, but not the Ozone version. I don't have the resources to build the Ozone version from source.

Gotcha. So Chromium X11/XWayland, in this case. I've been also experiencing some issues with XWayland under Sway :( eg: tab dragging totally broken, etc.

@nickdiego was window closing issue fixed as well?

@ninja- Which one? Have you reported it at crbug.com? We've been fixing many bugs recently, several of them related to popup windows.

@nickdiego I haven't experienced that, just reading from that AUR comments, said that was a major blocker

it worked like a charm here. Electron wayland native brings me a lot of comfort, thanks (AUR + recompile vscodium)

Very excited here as an Electron app maintainer.

Does this mean a future electron build will support Wayland natively out of the box or will I have to do something special for my app?

You are all amazing.

I recently tested on Wayland with Gnome however there wasn't any frame around the window.

@MyIsaak did you use your previous user data dir? I think the answer is yes. Do you your chrome settings set to "use system title bar and borders" from your old data dir? If yes, that's expected, because xdg-decorations support is on it's way.

@msisov I just rebuild the whole project again and still had the same result. Do I need to change the chrome settings before building as I only did so after building?

By default, chromium will try to reuse your existing user data dir.

Try to use something empty. Eg. - —user-data-dir=/tmp/blah

@msisov Ok it worked switching to the frameless/borderless version, except for closing the window (unless I do ALT+F4). VSCode also worked the same way by setting "window.titleBarStyle": "custom" in settings.json. Thanks for the help!

I tried master chromium with ozone support and running it on gnome shell results in 100% cpu usage forever and chromium not starting :(
It starts just fine on weston :(

OS: Ubuntu 20.04

@ninja- , please run with WAYLAND_DEBUG=1 and paste the log here. Possibly related to https://crbug.com/1123382 . The fix on its way.

@msisov yes this is it! Could you btw. handle the case properly when gnome shell disconnects your wayland connection? Because currently it just keeps spinning eventfd with 100% cpu :/

[1894729.120]  -> [email protected]_registry(new id wl_registry@2)
[1894738.037]  -> [email protected](new id wl_callback@3)
[1894738.116] [email protected]_id(3)
[1894738.146] [email protected](1, "wl_drm", 2)
[1894738.160]  -> [email protected](1, "wl_drm", 2, new id [unknown]@4)
[1894738.181]  -> [email protected](new id wl_callback@5)
[1894738.186] [email protected](2, "wl_compositor", 4)
[1894738.195]  -> [email protected](2, "wl_compositor", 4, new id [unknown]@6)
[1894738.212] [email protected](3, "wl_shm", 1)
[1894738.218]  -> [email protected](3, "wl_shm", 1, new id [unknown]@7)
[1894738.231] [email protected](4, "wl_output", 2)
[1894738.242]  -> [email protected](4, "wl_output", 2, new id [unknown]@8)
[1894738.252] [email protected](5, "wl_output", 2)
[1894738.258]  -> [email protected](5, "wl_output", 2, new id [unknown]@9)
[1894738.275] [email protected](6, "zxdg_output_manager_v1", 3)
[1894738.282] [email protected](7, "wl_data_device_manager", 3)
[1894738.293]  -> [email protected](7, "wl_data_device_manager", 3, new id [unknown]@10)
[1894738.308] [email protected](8, "zwp_primary_selection_device_manager_v1", 1)
[1894738.319] [email protected](9, "gtk_primary_selection_device_manager", 1)
[1894738.328]  -> [email protected](9, "gtk_primary_selection_device_manager", 1, new id [unknown]@11)
[1894738.349] [email protected](10, "wl_subcompositor", 1)
[1894738.358]  -> [email protected](10, "wl_subcompositor", 1, new id [unknown]@12)
[1894738.370] [email protected](11, "xdg_wm_base", 3)
[1894738.382]  -> [email protected](11, "xdg_wm_base", 1, new id [unknown]@13)
[1894738.396] [email protected](12, "zxdg_shell_v6", 1)
[1894738.406]  -> [email protected](12, "zxdg_shell_v6", 1, new id [unknown]@14)
[1894738.418] [email protected](13, "wl_shell", 1)
[1894738.429] [email protected](14, "gtk_shell1", 3)
[1894738.438] [email protected](15, "wp_viewporter", 1)
[1894738.447] [email protected](16, "zwp_pointer_gestures_v1", 1)
[1894738.457] [email protected](17, "zwp_tablet_manager_v2", 1)
[1894738.465] [email protected](18, "wl_seat", 5)
[1894738.476]  -> [email protected](18, "wl_seat", 4, new id [unknown]@15)
[1894738.491]  -> [email protected]_data_device(new id wl_data_device@16, wl_seat@15)
[1894738.510] [email protected](19, "zwp_relative_pointer_manager_v1", 1)
[1894738.520] [email protected](20, "zwp_pointer_constraints_v1", 1)
[1894738.531] [email protected](21, "zxdg_exporter_v1", 1)
[1894738.539] [email protected](22, "zxdg_importer_v1", 1)
[1894738.548] [email protected](23, "zwp_linux_dmabuf_v1", 3)
[1894738.559]  -> [email protected](23, "zwp_linux_dmabuf_v1", 3, new id [unknown]@17)
[1894738.573]  -> [email protected](new id wl_callback@18)
[1894738.579] [email protected](24, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1894738.593] [email protected](25, "zwp_text_input_manager_v3", 1)
[1894738.604] [email protected](26, "gtk_text_input_manager", 1)
[1894738.618] [email protected](152130)
[1894738.728] [email protected]_id(5)
[1894738.732] [email protected]_id(18)
[1894738.737] [email protected]("/dev/dri/card0")
[1894738.903]  -> [email protected](4)
[1894738.908]  -> [email protected](new id wl_callback@3)
[1894738.914] [email protected](808669761)
[1894738.920] [email protected](808669784)
[1894738.925] [email protected](808665665)
[1894738.930] [email protected](808665688)
[1894738.932] [email protected](875713089)
[1894738.936] [email protected](875713112)
[1894738.940] [email protected](909199186)
[1894738.944] [email protected](961959257)
[1894738.948] [email protected](825316697)
[1894738.952] [email protected](842093913)
[1894738.955] [email protected](909202777)
[1894738.961] [email protected](875713881)
[1894738.965] [email protected](842094158)
[1894738.970] [email protected](909203022)
[1894738.976] [email protected](1448695129)
[1894738.981] [email protected](1)
[1894738.985] [email protected](152130)
[1894738.989] [email protected](1920, 0, 530, 300, 0, "DEL", "DELL P2419H", 0)
[1894739.009] [email protected](3, 1920, 1080, 60000)
[1894739.020] [email protected](1)
[1894739.024] [email protected]()
[1894739.028] [email protected](0, 0, 530, 300, 0, "DEL", "DELL P2419H", 0)
[1894739.046] [email protected](3, 1920, 1080, 60000)
[1894739.057] [email protected](1)
[1894739.060] [email protected]()
[1894739.064] [email protected](3)
[1894739.069]  -> [email protected]_pointer(new id wl_pointer@5)
[1894739.076]  -> [email protected]_surface(new id wl_surface@19)
[1894739.081]  -> [email protected]_keyboard(new id wl_keyboard@20)
[1894739.088] [email protected]("seat0")
[1894739.092] [email protected](875713089)
[1894739.096] [email protected](875713089, 16777215, 4294967295)
[1894739.107] [email protected](875713112)
[1894739.114] [email protected](875713112, 16777215, 4294967295)
[1894739.120] [email protected](808669761)
[1894739.124] [email protected](808669761, 16777215, 4294967295)
[1894739.134] [email protected](909199186)
[1894739.138] [email protected](909199186, 16777215, 4294967295)
[1894739.150] [email protected](152130)
[1894739.345] [email protected]_id(3)
[1894739.349] [email protected]()
[1894739.354] [email protected](152130)
[1894739.357] [email protected](1, fd 32, 54533)
[1894740.677] [email protected]_info(33, 500)
[1894773.934]  -> [email protected]_registry(new id wl_registry@2)
[1894773.945]  -> [email protected](new id wl_callback@3)
[1894773.990] [email protected]_id(3)
[1894773.994] [email protected](1, "wl_drm", 2)
[1894774.003] [email protected](2, "wl_compositor", 4)
[1894774.011]  -> [email protected](2, "wl_compositor", 3, new id [unknown]@4)
[1894774.022] [email protected](3, "wl_shm", 1)
[1894774.030]  -> [email protected](3, "wl_shm", 1, new id [unknown]@5)
[1894774.077]  -> [email protected]_pool(new id wl_shm_pool@6, fd 38, 2304)
[1894774.189]  -> [email protected](6912)
[1894774.231]  -> [email protected](16128)
[1894774.296]  -> [email protected](34560)
[1894774.476]  -> [email protected](71424)
[1894774.738]  -> [email protected](145152)
[1894775.331]  -> [email protected](292608)
[1894776.011]  -> [email protected](587520)
[1894777.122]  -> [email protected](1177344)
[1894782.938] [email protected](4, "wl_output", 2)
[1894782.947]  -> [email protected](4, "wl_output", 2, new id [unknown]@7)
[1894782.983]  -> [email protected](new id wl_callback@8)
[1894782.988] [email protected](5, "wl_output", 2)
[1894782.995]  -> [email protected](5, "wl_output", 2, new id [unknown]@9)
[1894783.012]  -> [email protected](new id wl_callback@10)
[1894783.017] [email protected](6, "zxdg_output_manager_v1", 3)
[1894783.025]  -> [email protected](6, "zxdg_output_manager_v1", 3, new id [unknown]@11)
[1894783.041]  -> [email protected]_xdg_output(new id zxdg_output_v1@12, wl_output@7)
[1894783.046]  -> [email protected]_xdg_output(new id zxdg_output_v1@13, wl_output@9)
[1894783.055]  -> [email protected](new id wl_callback@14)
[1894783.061] [email protected](7, "wl_data_device_manager", 3)
[1894783.069]  -> [email protected](7, "wl_data_device_manager", 3, new id [unknown]@15)
[1894783.080] [email protected](8, "zwp_primary_selection_device_manager_v1", 1)
[1894783.088] [email protected](9, "gtk_primary_selection_device_manager", 1)
[1894783.098]  -> [email protected](9, "gtk_primary_selection_device_manager", 1, new id [unknown]@16)
[1894783.108] [email protected](10, "wl_subcompositor", 1)
[1894783.115]  -> [email protected](10, "wl_subcompositor", 1, new id [unknown]@17)
[1894783.131] [email protected](11, "xdg_wm_base", 3)
[1894783.138] [email protected](12, "zxdg_shell_v6", 1)
[1894783.144] [email protected](13, "wl_shell", 1)
[1894783.152] [email protected](14, "gtk_shell1", 3)
[1894783.167]  -> [email protected](14, "gtk_shell1", 3, new id [unknown]@18)
[1894783.188] [email protected](15, "wp_viewporter", 1)
[1894783.197] [email protected](16, "zwp_pointer_gestures_v1", 1)
[1894783.205]  -> [email protected](16, "zwp_pointer_gestures_v1", 1, new id [unknown]@19)
[1894783.223] [email protected](17, "zwp_tablet_manager_v2", 1)
[1894783.230]  -> [email protected](17, "zwp_tablet_manager_v2", 1, new id [unknown]@20)
[1894783.241] [email protected](18, "wl_seat", 5)
[1894783.248]  -> [email protected](18, "wl_seat", 5, new id [unknown]@21)
[1894784.921]  -> [email protected]_surface(new id wl_surface@22)
[1894784.934]  -> [email protected]_device(new id gtk_primary_selection_device@23, wl_seat@21)
[1894784.943]  -> [email protected]_data_device(new id wl_data_device@24, wl_seat@21)
[1894785.027]  -> [email protected]_surface(new id wl_surface@25)
[1894785.031]  -> [email protected]_tablet_seat(new id zwp_tablet_seat_v2@26, wl_seat@21)
[1894785.040]  -> [email protected](new id wl_callback@27)
[1894785.045] [email protected](19, "zwp_relative_pointer_manager_v1", 1)
[1894785.053] [email protected](20, "zwp_pointer_constraints_v1", 1)
[1894785.060] [email protected](21, "zxdg_exporter_v1", 1)
[1894785.068]  -> [email protected](21, "zxdg_exporter_v1", 1, new id [unknown]@28)
[1894785.080] [email protected](22, "zxdg_importer_v1", 1)
[1894785.089]  -> [email protected](22, "zxdg_importer_v1", 1, new id [unknown]@29)
[1894785.101] [email protected](23, "zwp_linux_dmabuf_v1", 3)
[1894785.110] [email protected](24, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1894785.117]  -> [email protected](24, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1, new id [unknown]@30)
[1894785.129] [email protected](25, "zwp_text_input_manager_v3", 1)
[1894785.136] [email protected](26, "gtk_text_input_manager", 1)
[1894785.145] [email protected](152130)
[1894785.277] [email protected]_id(8)
[1894785.281] [email protected]_id(10)
[1894785.283] [email protected]_id(14)
[1894785.287] [email protected]_id(27)
[1894785.293] [email protected](0)
[1894785.296] [email protected](1)
[1894785.301] [email protected](1920, 0, 530, 300, 0, "", "", 0)
[1894785.321] [email protected](3, 1920, 1080, 60000)
[1894785.327] [email protected](1)
[1894785.330] [email protected]()
[1894785.336] [email protected](152130)
[1894785.339] [email protected](0, 0, 530, 300, 0, "", "", 0)
[1894785.357] [email protected](3, 1920, 1080, 60000)
[1894785.362] [email protected](1)
[1894785.365] [email protected]()
[1894785.369] [email protected](152130)
[1894785.372] [email protected]_position(1920, 0)
[1894785.375] [email protected]_size(1920, 1080)
[1894785.379] [email protected]()
[1894785.383] [email protected]("")
[1894785.386] [email protected]()
[1894785.390] [email protected]_position(0, 0)
[1894785.395] [email protected]_size(1920, 1080)
[1894785.400] [email protected]("")
[1894785.403] [email protected](""")
[1894785.406] [email protected]()
[1894785.410] [email protected](152130)
[1894785.414] [email protected](0)
[1894785.421] [email protected](3)
[1894785.425]  -> [email protected]_pointer(new id wl_pointer@14)
[1894785.437]  -> [email protected]_swipe_gesture(new id zwp_pointer_gesture_swipe_v1@10, wl_pointer@14)
[1894785.445]  -> [email protected]_pinch_gesture(new id zwp_pointer_gesture_pinch_v1@8, wl_pointer@14)
[1894785.452]  -> [email protected]_keyboard(new id wl_keyboard@3)
[1894785.460] [email protected]("seat0")
[1894785.463] [email protected](152130)
[1894785.467]  -> [email protected](11, "xdg_wm_base", 1, new id [unknown]@27)
[1894840.113]  -> [email protected]_surface(new id wl_surface@31)
[1896097.874]  -> [email protected]_registry(new id wl_registry@2)
[1896097.897]  -> [email protected](new id wl_callback@3)
[1896097.947] [email protected]_id(3)
[1896097.962] [email protected](1, "wl_drm", 2)
[1896097.968]  -> [email protected](1, "wl_drm", 2, new id [unknown]@4)
[1896097.978] [email protected](2, "wl_compositor", 4)
[1896097.985] [email protected](3, "wl_shm", 1)
[1896097.993] [email protected](4, "wl_output", 2)
[1896098.000] [email protected](5, "wl_output", 2)
[1896098.006] [email protected](6, "zxdg_output_manager_v1", 3)
[1896098.015] [email protected](7, "wl_data_device_manager", 3)
[1896098.025] [email protected](8, "zwp_primary_selection_device_manager_v1", 1)
[1896098.036] [email protected](9, "gtk_primary_selection_device_manager", 1)
[1896098.050] [email protected](10, "wl_subcompositor", 1)
[1896098.059] [email protected](11, "xdg_wm_base", 3)
[1896098.068] [email protected](12, "zxdg_shell_v6", 1)
[1896098.077] [email protected](13, "wl_shell", 1)
[1896098.091] [email protected](14, "gtk_shell1", 3)
[1896098.099] [email protected](15, "wp_viewporter", 1)
[1896098.108] [email protected](16, "zwp_pointer_gestures_v1", 1)
[1896098.116] [email protected](17, "zwp_tablet_manager_v2", 1)
[1896098.127] [email protected](18, "wl_seat", 5)
[1896098.133] [email protected](19, "zwp_relative_pointer_manager_v1", 1)
[1896098.138] [email protected](20, "zwp_pointer_constraints_v1", 1)
[1896098.150] [email protected](21, "zxdg_exporter_v1", 1)
[1896098.158] [email protected](22, "zxdg_importer_v1", 1)
[1896098.166] [email protected](23, "zwp_linux_dmabuf_v1", 3)
[1896098.173]  -> [email protected](23, "zwp_linux_dmabuf_v1", 3, new id [unknown]@5)
[1896098.184] [email protected](24, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1896098.193] [email protected](25, "zwp_text_input_manager_v3", 1)
[1896098.206] [email protected](26, "gtk_text_input_manager", 1)
[1896098.215] [email protected](152134)
[1896098.219]  -> [email protected](new id wl_callback@3)
[1896098.293] [email protected]_id(3)
[1896098.296] [email protected]("/dev/dri/card0")
[1896098.425]  -> [email protected](4)
[1896098.429] [email protected](808669761)
[1896098.435] [email protected](808669784)
[1896098.439] [email protected](808665665)
[1896098.441] [email protected](808665688)
[1896098.444] [email protected](875713089)
[1896098.447] [email protected](875713112)
[1896098.450] [email protected](909199186)
[1896098.454] [email protected](961959257)
[1896098.459] [email protected](825316697)
[1896098.464] [email protected](842093913)
[1896098.467] [email protected](909202777)
[1896098.470] [email protected](875713881)
[1896098.473] [email protected](842094158)
[1896098.476] [email protected](909203022)
[1896098.479] [email protected](1448695129)
[1896098.483] [email protected](1)
[1896098.486] [email protected](875713089)
[1896098.492] [email protected](875713089, 16777215, 4294967295)
[1896098.500] [email protected](875713112)
[1896098.512] [email protected](875713112, 16777215, 4294967295)
[1896098.525] [email protected](808669761)
[1896098.529] [email protected](808669761, 16777215, 4294967295)
[1896098.539] [email protected](909199186)
[1896098.544] [email protected](909199186, 16777215, 4294967295)
[1896098.554] [email protected](152134)
[1896098.560]  -> [email protected](new id wl_callback@3)
[1896098.585] [email protected]_id(3)
[1896098.588] [email protected]()
[1896098.590] [email protected](152134)
[1739236:1739236:0911/113806.380850:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[1899569.137]  -> [email protected]_surface(new id wl_surface@3)
[1899569.182]  -> [email protected]_region(new id wl_region@18)
[1899569.186]  -> [email protected](0, 0, 945, 640)
[1899569.197]  -> [email protected]_opaque_region(wl_region@18)
[1899569.201]  -> [email protected]()
[1899895.275]  -> [email protected]_xdg_surface(new id xdg_surface@21, wl_surface@3)
[1899895.294]  -> [email protected]_toplevel(new id xdg_toplevel@22)
[1899895.299]  -> [email protected]()
[1899895.302]  -> [email protected]_app_id("Chromium-browser")
[1899895.310]  -> [email protected]_fullscreen()
[1899895.312]  -> [email protected]_maximized()
[1900760.265] [email protected](1, fd 74, 54533)
[1900762.215] [email protected]_info(33, 500)
[1900762.250] [email protected]_id(18)
[1900762.255] [email protected](0, 0, array)
[1900762.267]  -> [email protected]_window_geometry(0, 0, 945, 640)
[1900762.279] [email protected](6108)
[1900762.284]  -> [email protected]_configure(6108)
[1902493.196]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@18)
[1902493.215]  -> [email protected](fd 177, 0, 0, 4096, 16777215, 4294967295)
[1902493.226]  -> [email protected]_immed(new id wl_buffer@23, 945, 640, 875708993, 0)
[1902493.276]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@24)
[1902493.280]  -> [email protected](fd 170, 0, 0, 4096, 16777215, 4294967295)
[1902493.290]  -> [email protected]_immed(new id wl_buffer@25, 945, 640, 875708993, 0)
[1902493.304]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@26)
[1902493.308]  -> [email protected](fd 171, 0, 0, 4096, 16777215, 4294967295)
[1902493.317]  -> [email protected]_immed(new id wl_buffer@27, 945, 640, 875708993, 0)
[1902493.564] [email protected](zwp_linux_buffer_params_v1@18, 7, "failed to import supplied dmabufs: Unsupported buffer format 875708993")

@ninja- , yup. I will.

@ninja- , In case if you compile chromium by yourself, this patch makes it possible to gracefully shutdown the browser + makes it possible to print the error message that libwayland-client sends and this patch fixes the problem with unsupported buffer. You can apply them and verify that the problem is fixed.

Fractional scale working like a charm in Fedora 32 with GNOME

Chrome 84 vs Chrome Dev 87 (wayland enabled)
chrome

This will be a huge step for electron apps and wayland users

well, I have to admit it works partly and depends on what value wayland passes. The problem is that wl_output doesn't support fractional scaling. And if it rounds 150% to 200%, then chromium will get "correct" value.

Otherwise, xdg_output should be used (Chromium will calculate scaling from physical and logical size of a display). And this work is under development right now.

well, I have to admit it works partly and depends on what value wayland passes. The problem is that wl_output doesn't support fractional scaling. And if it rounds 150% to 200%, then chromium will get "correct" value.

I see, makes sense, I was using 150% for the test

@msisov your fix finally landed in a weekly dev snap build - works great! thanks!

Previously Chrome has been freezing on my pc every couple of seconds - I really have no idea if that's a kernel, amdgpu, chromium, xwayland or gnome-shell bug :/
I hope it will be better now with pure Wayland.

@refi64 thanks a lot for bringing that up! interesting

As this is no longer blocked by upstream what is the plan going forward? Chrome 87 (now in Beta) ships with wayland as an ozone platform which can be enabled using google-chrome-beta --enable-features=UseOzonePlatform --ozone-platform=wayland from the official Chrome PPA. Currently electron@beta however which ships said chrome version does not support wayland in the prebuilt binary.

There already seems to be some effort from @vially to refactor some code to allow future wayland support in the builds. Are there any other major hurdles?

TLDR

Electron's Chromium dependency is currently pointing to a version which crashes on startup on Wayland (chromium#1128997).

Once that's no longer the case (e.g.: after the next one or two chromium bumps) I'm planning to adjust and try to upstream @hedgepigdaniel's patches in order to enable Wayland support in the official Electron builds.

Technical details

Pre Chromium 87 patches

One of the challenges with upstreaming the current Wayland patches is due to Electron's recent bump of Chromium to version 87 which enables both Ozone and non-Ozone code paths in the same build (chromium#1085700).

These Electron Wayland patches were written with the assumption that a build is either an X11 build (USE_X11) or an Ozone build (USE_OZONE), which was true until version 87, but is no longer the case after that.

This means that the patches need to be adjusted to account for the fact that now both USE_X11 and USE_OZONE can be both true at the same time.

Post Chromium 87 patches

My plan was to take the existing patches, adjust them by borrowing the patterns from chromium#1085700 (which I did in this branch) and then upstream them to Electron.

However, due to a bug which was fixed in the meantime in Chromium (chromium#1128997) but didn't yet make it into Electron, my Wayland fork currently generates a build that fails to start on Wayland (electron --enable-features=UseOzonePlatform --ozone-platform=wayland crashes with the same error as in the Chromium bug report).

Running the same Electron build with Ozone/X11 (electron --enable-features=UseOzonePlatform --ozone-platform=x11) seems to work fine with these patches, which is a good sign I guess.

So right now I'm just waiting for a few more Chromium bumps in Electron which should get rid of the current problem, but is very likely to uncover another.

And I know there will be another since I manually backported chromium#2434928 and the build still fails to start, but this time with a different stacktrace. I currently have no idea why it happens or how to fix this, but I kind of hope it will be automatically fixed by the next Chromium bump(s).

This is part of the stacktrace if anyone is interested in taking a look. It seems to suggest it may also be related to buffer initialization (maybe chromium#2343545?), but I can't tell for sure. Maybe it rings a bell to @msisov or @nickdiego.


Stack trace

[19947:1003/140001.730007:INFO:content_main_runner_impl.cc(976)] Chrome is running in full browser mode.
[4248247.318]  -> [email protected]_registry(new id wl_registry@2)
[4248247.345]  -> [email protected](new id wl_callback@3)
[4248247.458] [email protected]_id(3)
[4248247.470] [email protected](1, "wl_shm", 1)
[4248247.481]  -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[4248247.503] [email protected](2, "wl_drm", 2)
[4248247.513]  -> [email protected](2, "wl_drm", 2, new id [unknown]@5)
[4248247.528]  -> [email protected](new id wl_callback@6)
[4248247.534] [email protected](3, "zwp_linux_dmabuf_v1", 3)
[4248247.544]  -> [email protected](3, "zwp_linux_dmabuf_v1", 3, new id [unknown]@7)
[4248247.558]  -> [email protected](new id wl_callback@8)
[4248247.564] [email protected](4, "wl_compositor", 4)
[4248247.574]  -> [email protected](4, "wl_compositor", 4, new id [unknown]@9)
[4248247.587] [email protected](5, "wl_subcompositor", 1)
[4248247.597]  -> [email protected](5, "wl_subcompositor", 1, new id [unknown]@10)
[4248247.610] [email protected](6, "wl_data_device_manager", 3)
[4248247.620]  -> [email protected](6, "wl_data_device_manager", 3, new id [unknown]@11)
[4248247.634] [email protected](7, "zwlr_gamma_control_manager_v1", 1)
[4248247.644] [email protected](8, "gtk_primary_selection_device_manager", 1)
[4248247.654]  -> [email protected](8, "gtk_primary_selection_device_manager", 1, new id [unknown]@12)
[4248247.667] [email protected](9, "zxdg_output_manager_v1", 3)
[4248247.677] [email protected](10, "org_kde_kwin_idle", 1)
[4248247.687] [email protected](11, "zwp_idle_inhibit_manager_v1", 1)
[4248247.697] [email protected](12, "zwlr_layer_shell_v1", 2)
[4248247.706] [email protected](13, "xdg_wm_base", 2)
[4248247.716]  -> [email protected](13, "xdg_wm_base", 1, new id [unknown]@13)
[4248247.730] [email protected](14, "zwp_tablet_manager_v2", 1)
[4248247.740] [email protected](15, "org_kde_kwin_server_decoration_manager", 1)
[4248247.749] [email protected](16, "zxdg_decoration_manager_v1", 1)
[4248247.762]  -> [email protected](16, "zxdg_decoration_manager_v1", 1, new id [unknown]@14)
[4248247.775] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[4248247.785] [email protected](18, "zwp_pointer_constraints_v1", 1)
[4248247.795] [email protected](19, "wp_presentation", 1)
[4248247.805]  -> [email protected](19, "wp_presentation", 1, new id [unknown]@15)
[4248247.818] [email protected](20, "zwlr_output_manager_v1", 1)
[4248247.828] [email protected](21, "zwlr_output_power_manager_v1", 1)
[4248247.838] [email protected](22, "zwp_input_method_manager_v2", 1)
[4248247.847] [email protected](23, "zwp_text_input_manager_v3", 1)
[4248247.858] [email protected](24, "zwlr_foreign_toplevel_manager_v1", 2)
[4248247.867] [email protected](25, "zwlr_export_dmabuf_manager_v1", 1)
[4248247.877] [email protected](26, "zwlr_screencopy_manager_v1", 3)
[4248247.887] [email protected](27, "zwlr_data_control_manager_v1", 2)
[4248247.896] [email protected](28, "zwp_primary_selection_device_manager_v1", 1)
[4248247.906] [email protected](29, "wp_viewporter", 1)
[4248247.916] [email protected](30, "zwp_virtual_keyboard_manager_v1", 1)
[4248247.925] [email protected](31, "zwlr_virtual_pointer_manager_v1", 2)
[4248247.935] [email protected](32, "zwlr_input_inhibit_manager_v1", 1)
[4248247.945] [email protected](33, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[4248247.954] [email protected](34, "wl_seat", 7)
[4248247.964]  -> [email protected](34, "wl_seat", 5, new id [unknown]@16)
[4248247.978]  -> [email protected]_data_device(new id wl_data_device@17, wl_seat@16)
[4248247.989] [email protected](35, "zwp_pointer_gestures_v1", 1)
[4248247.999] [email protected](39, "wl_output", 3)
[4248248.008]  -> [email protected](39, "wl_output", 3, new id [unknown]@18)
[4248248.022] [email protected](40, "wl_output", 3)
[4248248.032]  -> [email protected](40, "wl_output", 3, new id [unknown]@19)
[4248248.052] [email protected](41, "wl_output", 3)
[4248248.062]  -> [email protected](41, "wl_output", 3, new id [unknown]@20)
[4248248.075] [email protected](2593)
[4248248.203] [email protected]_id(6)
[4248248.210] [email protected]_id(8)
[4248248.215] [email protected]("/dev/dri/card0")
[4248248.399]  -> [email protected](6)
[4248248.406]  -> [email protected](new id wl_callback@3)
[4248248.413] [email protected](808669761)
[4248248.421] [email protected](808669784)
[4248248.427] [email protected](808665665)
[4248248.432] [email protected](808665688)
[4248248.436] [email protected](875713089)
[4248248.441] [email protected](875713112)
[4248248.445] [email protected](909199186)
[4248248.450] [email protected](961959257)
[4248248.455] [email protected](825316697)
[4248248.459] [email protected](842093913)
[4248248.464] [email protected](909202777)
[4248248.468] [email protected](875713881)
[4248248.473] [email protected](842094158)
[4248248.477] [email protected](909203022)
[4248248.482] [email protected](1448695129)
[4248248.486] [email protected](1)
[4248248.491] [email protected](2593)
[4248248.496] [email protected](1211384385, 16777215, 4294967295)
[4248248.506] [email protected](1211384408, 16777215, 4294967295)
[4248248.516] [email protected](808669761, 16777215, 4294967295)
[4248248.526] [email protected](808669784, 16777215, 4294967295)
[4248248.535] [email protected](808665665, 16777215, 4294967295)
[4248248.545] [email protected](808665688, 16777215, 4294967295)
[4248248.555] [email protected](875713089, 16777215, 4294967295)
[4248248.564] [email protected](875708993, 16777215, 4294967295)
[4248248.574] [email protected](875713112, 16777215, 4294967295)
[4248248.584] [email protected](875709016, 16777215, 4294967295)
[4248248.593] [email protected](892424769, 16777215, 4294967295)
[4248248.603] [email protected](909199186, 16777215, 4294967295)
[4248248.613] [email protected](538982482, 16777215, 4294967295)
[4248248.622] [email protected](540422482, 16777215, 4294967295)
[4248248.632] [email protected](943215175, 16777215, 4294967295)
[4248248.642] [email protected](842224199, 16777215, 4294967295)
[4248248.651] [email protected](961959257, 16777215, 4294967295)
[4248248.661] [email protected](825316697, 16777215, 4294967295)
[4248248.671] [email protected](842093913, 16777215, 4294967295)
[4248248.680] [email protected](909202777, 16777215, 4294967295)
[4248248.690] [email protected](875713881, 16777215, 4294967295)
[4248248.699] [email protected](961893977, 16777215, 4294967295)
[4248248.709] [email protected](825316953, 16777215, 4294967295)
[4248248.718] [email protected](842094169, 16777215, 4294967295)
[4248248.728] [email protected](909203033, 16777215, 4294967295)
[4248248.738] [email protected](875714137, 16777215, 4294967295)
[4248248.748] [email protected](842094158, 16777215, 4294967295)
[4248248.757] [email protected](808530000, 16777215, 4294967295)
[4248248.767] [email protected](842084432, 16777215, 4294967295)
[4248248.776] [email protected](909193296, 16777215, 4294967295)
[4248248.786] [email protected](909203022, 16777215, 4294967295)
[4248248.796] [email protected](1448433985, 16777215, 4294967295)
[4248248.805] [email protected](1448434008, 16777215, 4294967295)
[4248248.815] [email protected](1448695129, 16777215, 4294967295)
[4248248.824] [email protected](1498831189, 16777215, 4294967295)
[4248248.834] [email protected](2593)
[4248248.839] [email protected]("seat0")
[4248248.844] [email protected](3)
[4248248.849]  -> [email protected]_pointer(new id wl_pointer@8)
[4248248.855]  -> [email protected]_surface(new id wl_surface@6)
[4248248.861]  -> [email protected]_keyboard(new id wl_keyboard@21)
[4248248.875] [email protected](0, 0, 600, 340, 0, "Goldstar Company Ltd", "LG Ultra HD", 0)
[4248248.898] [email protected](1, 3840, 2160, 59997)
[4248248.911] [email protected](2)
[4248248.916] [email protected]()
[4248248.919] [email protected](0, 0, 600, 340, 0, "Goldstar Company Ltd", "LG Ultra HD", 0)
[4248248.942] [email protected](1, 3840, 2160, 59997)
[4248248.954] [email protected](2)
[4248248.959] [email protected]()
[4248248.962] [email protected](0, 0, 600, 340, 0, "Acer Technologies", "XV273K", 0)
[4248248.984] [email protected](1, 3840, 2160, 119910)
[4248248.996] [email protected](2)
[4248249.001] [email protected]()
[4248249.127] [email protected]_id(3)
[4248249.133] [email protected]()
[4248249.137] [email protected](2593)
[4248249.141] [email protected](1, fd 151, 48238)
[4248250.377] [email protected]_info(25, 600)
[4248252.512]  -> [email protected]_registry(new id wl_registry@2)
[4248252.523]  -> [email protected](new id wl_callback@3)
[4248252.568] [email protected]_id(3)
[4248252.575] [email protected](1, "wl_shm", 1)
[4248252.586]  -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[4248252.617]  -> [email protected]_pool(new id wl_shm_pool@5, fd 157, 2304)
[4248252.728]  -> [email protected](6912)
[4248252.787]  -> [email protected](16128)
[4248253.706]  -> [email protected](34560)
[4248253.734]  -> [email protected](71424)
[4248253.771]  -> [email protected](145152)
[4248253.836]  -> [email protected](292608)
[4248254.912]  -> [email protected](587520)
[4248257.613]  -> [email protected](1177344)
[4248267.711] [email protected](2, "wl_drm", 2)
[4248267.726] [email protected](3, "zwp_linux_dmabuf_v1", 3)
[4248267.736] [email protected](4, "wl_compositor", 4)
[4248267.746]  -> [email protected](4, "wl_compositor", 3, new id [unknown]@6)
[4248267.760] [email protected](5, "wl_subcompositor", 1)
[4248267.770]  -> [email protected](5, "wl_subcompositor", 1, new id [unknown]@7)
[4248267.784] [email protected](6, "wl_data_device_manager", 3)
[4248267.794]  -> [email protected](6, "wl_data_device_manager", 3, new id [unknown]@8)
[4248267.808] [email protected](7, "zwlr_gamma_control_manager_v1", 1)
[4248267.818] [email protected](8, "gtk_primary_selection_device_manager", 1)
[4248267.827]  -> [email protected](8, "gtk_primary_selection_device_manager", 1, new id [unknown]@9)
[4248267.842] [email protected](9, "zxdg_output_manager_v1", 3)
[4248267.852]  -> [email protected](9, "zxdg_output_manager_v1", 3, new id [unknown]@10)
[4248267.866]  -> [email protected](new id wl_callback@11)
[4248267.872] [email protected](10, "org_kde_kwin_idle", 1)
[4248267.882] [email protected](11, "zwp_idle_inhibit_manager_v1", 1)
[4248267.892] [email protected](12, "zwlr_layer_shell_v1", 2)
[4248267.902] [email protected](13, "xdg_wm_base", 2)
[4248267.912] [email protected](14, "zwp_tablet_manager_v2", 1)
[4248267.921]  -> [email protected](14, "zwp_tablet_manager_v2", 1, new id [unknown]@12)
[4248267.935] [email protected](15, "org_kde_kwin_server_decoration_manager", 1)
[4248267.945]  -> [email protected](15, "org_kde_kwin_server_decoration_manager", 1, new id [unknown]@13)
[4248267.958] [email protected](16, "zxdg_decoration_manager_v1", 1)
[4248267.969] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[4248267.979] [email protected](18, "zwp_pointer_constraints_v1", 1)
[4248267.989] [email protected](19, "wp_presentation", 1)
[4248267.998] [email protected](20, "zwlr_output_manager_v1", 1)
[4248268.008] [email protected](21, "zwlr_output_power_manager_v1", 1)
[4248268.018] [email protected](22, "zwp_input_method_manager_v2", 1)
[4248268.028] [email protected](23, "zwp_text_input_manager_v3", 1)
[4248268.038] [email protected](24, "zwlr_foreign_toplevel_manager_v1", 2)
[4248268.048] [email protected](25, "zwlr_export_dmabuf_manager_v1", 1)
[4248268.058] [email protected](26, "zwlr_screencopy_manager_v1", 3)
[4248268.072] [email protected](27, "zwlr_data_control_manager_v1", 2)
[4248268.082] [email protected](28, "zwp_primary_selection_device_manager_v1", 1)
[4248268.093] [email protected](29, "wp_viewporter", 1)
[4248268.102] [email protected](30, "zwp_virtual_keyboard_manager_v1", 1)
[4248268.112] [email protected](31, "zwlr_virtual_pointer_manager_v1", 2)
[4248268.123] [email protected](32, "zwlr_input_inhibit_manager_v1", 1)
[4248268.133] [email protected](33, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[4248268.143]  -> [email protected](33, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1, new id [unknown]@14)
[4248268.157] [email protected](34, "wl_seat", 7)
[4248268.167]  -> [email protected](34, "wl_seat", 5, new id [unknown]@15)
[4248269.960]  -> [email protected]_surface(new id wl_surface@16)
[4248269.975]  -> [email protected]_device(new id gtk_primary_selection_device@17, wl_seat@15)
[4248269.985]  -> [email protected]_data_device(new id wl_data_device@18, wl_seat@15)
[4248270.059]  -> [email protected]_surface(new id wl_surface@19)
[4248270.067]  -> [email protected]_tablet_seat(new id zwp_tablet_seat_v2@20, wl_seat@15)
[4248270.076]  -> [email protected](new id wl_callback@21)
[4248270.084] [email protected](35, "zwp_pointer_gestures_v1", 1)
[4248270.095]  -> [email protected](35, "zwp_pointer_gestures_v1", 1, new id [unknown]@22)
[4248270.108] [email protected](39, "wl_output", 3)
[4248270.118]  -> [email protected](39, "wl_output", 2, new id [unknown]@23)
[4248270.152]  -> [email protected]_xdg_output(new id zxdg_output_v1@24, wl_output@23)
[4248270.162]  -> [email protected](new id wl_callback@25)
[4248270.168] [email protected](40, "wl_output", 3)
[4248270.178]  -> [email protected](40, "wl_output", 2, new id [unknown]@26)
[4248270.193]  -> [email protected]_xdg_output(new id zxdg_output_v1@27, wl_output@26)
[4248270.202]  -> [email protected](new id wl_callback@28)
[4248270.208] [email protected](41, "wl_output", 3)
[4248270.218]  -> [email protected](41, "wl_output", 2, new id [unknown]@29)
[4248270.232]  -> [email protected]_xdg_output(new id zxdg_output_v1@30, wl_output@29)
[4248270.240]  -> [email protected](new id wl_callback@31)
[4248270.246] [email protected](2596)
[4248270.373] [email protected]_id(11)
[4248270.381] [email protected]_id(21)
[4248270.386] [email protected]_id(25)
[4248270.391] [email protected]_id(28)
[4248270.395] [email protected]_id(31)
[4248270.400] [email protected](0)
[4248270.404] [email protected](1)
[4248270.409] [email protected](875709016)
[4248270.413] [email protected](875708993)
[4248270.418] [email protected](2596)
[4248270.423] [email protected]_mode(2)
[4248270.428] [email protected]("seat0")
[4248270.433] [email protected](3)
[4248270.438]  -> [email protected]_pointer(new id wl_pointer@11)
[4248270.452]  -> [email protected]_swipe_gesture(new id zwp_pointer_gesture_swipe_v1@3, wl_pointer@11)
[4248270.461]  -> [email protected]_pinch_gesture(new id zwp_pointer_gesture_pinch_v1@32, wl_pointer@11)
[4248270.470]  -> [email protected]_keyboard(new id wl_keyboard@33)
[4248270.481] [email protected](2596)
[4248270.487] [email protected](0, 0, 600, 340, 0, "Goldstar Company Ltd", "LG Ultra HD", 0)
[4248270.511] [email protected](1, 3840, 2160, 59997)
[4248270.524] [email protected](2)
[4248270.530] [email protected]()
[4248270.538] [email protected]("DP-3")
[4248270.544] [email protected]("Goldstar Company Ltd LG Ultra HD 0x0000E0B1 (DP-3)")
[4248270.548] [email protected]_position(3840, 0)
[4248270.556] [email protected]_size(1920, 1080)
[4248270.563] [email protected]()
[4248270.568] [email protected](2596)
[4248270.573] [email protected](0, 0, 600, 340, 0, "Goldstar Company Ltd", "LG Ultra HD", 0)
[4248270.597] [email protected](1, 3840, 2160, 59997)
[4248270.610] [email protected](2)
[4248270.614] [email protected]()
[4248270.619] [email protected]("DP-2")
[4248270.628] [email protected]("Goldstar Company Ltd LG Ultra HD 0x0000B9F1 (DP-2)")
[4248270.633] [email protected]_position(0, 0)
[4248270.640] [email protected]_size(1920, 1080)
[4248270.647] [email protected]()
[4248270.652] [email protected](2596)
[4248270.657] [email protected](0, 0, 600, 340, 0, "Acer Technologies", "XV273K", 0)
[4248270.681] [email protected](1, 3840, 2160, 119910)
[4248270.694] [email protected](2)
[4248270.699] [email protected]()
[4248270.704] [email protected]("DP-1")
[4248270.709] [email protected]("Acer Technologies XV273K 0x0000F25B (DP-1)")
[4248270.713] [email protected]_position(1920, 0)
[4248270.720] [email protected]_size(1920, 1080)
[4248270.727] [email protected]()
[4248270.733] [email protected](2596)
[4248270.738]  -> [email protected](13, "xdg_wm_base", 1, new id [unknown]@31)
[4248288.779]  -> [email protected]_surface(new id wl_surface@28)
[4248325.005]  -> [email protected]_surface(new id wl_surface@3)
[4248325.051]  -> [email protected]_buffer_scale(2)
[4248325.058]  -> [email protected]_region(new id wl_region@22)
[4248325.065]  -> [email protected](0, 0, 1920, 1240)
[4248325.077]  -> [email protected]_opaque_region(wl_region@22)
[4248325.083]  -> [email protected]()
[19947:1003/140002.022605:ERROR:wayland_window.cc(193)] Not implemented reached in virtual void ui::WaylandWindow::SetUseNativeFrame(bool)
[19947:1003/140002.022622:ERROR:wayland_window.cc(234)] Not implemented reached in virtual bool ui::WaylandWindow::ShouldWindowContentsBeTransparent() const
[19947:1003/140002.022730:ERROR:wayland_window.cc(244)] Not implemented reached in virtual void ui::WaylandWindow::SetWindowIcons(const gfx::ImageSkia &, const gfx::ImageSkia &)
[4248325.523]  -> [email protected]_region(new id wl_region@23)
[4248325.533]  -> [email protected](0, 0, 1920, 1240)
[4248325.545]  -> [email protected]_opaque_region(wl_region@23)
[4248325.551]  -> [email protected]()
[4248379.892]  -> [email protected]_registry(new id wl_registry@2)
[4248379.912]  -> [email protected](new id wl_callback@3)
[4248379.995] [email protected]_id(3)
[4248380.007] [email protected](1, "wl_shm", 1)
[4248380.017] [email protected](2, "wl_drm", 2)
[4248380.028]  -> [email protected](2, "wl_drm", 2, new id [unknown]@4)
[4248380.042] [email protected](3, "zwp_linux_dmabuf_v1", 3)
[4248380.052]  -> [email protected](3, "zwp_linux_dmabuf_v1", 3, new id [unknown]@5)
[4248380.066] [email protected](4, "wl_compositor", 4)
[4248380.075] [email protected](5, "wl_subcompositor", 1)
[4248380.085] [email protected](6, "wl_data_device_manager", 3)
[4248380.095] [email protected](7, "zwlr_gamma_control_manager_v1", 1)
[4248380.104] [email protected](8, "gtk_primary_selection_device_manager", 1)
[4248380.114] [email protected](9, "zxdg_output_manager_v1", 3)
[4248380.123] [email protected](10, "org_kde_kwin_idle", 1)
[4248380.133] [email protected](11, "zwp_idle_inhibit_manager_v1", 1)
[4248380.143] [email protected](12, "zwlr_layer_shell_v1", 2)
[4248380.152] [email protected](13, "xdg_wm_base", 2)
[4248380.162] [email protected](14, "zwp_tablet_manager_v2", 1)
[4248380.172] [email protected](15, "org_kde_kwin_server_decoration_manager", 1)
[4248380.182] [email protected](16, "zxdg_decoration_manager_v1", 1)
[4248380.191] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[4248380.201] [email protected](18, "zwp_pointer_constraints_v1", 1)
[4248380.211] [email protected](19, "wp_presentation", 1)
[4248380.220] [email protected](20, "zwlr_output_manager_v1", 1)
[4248380.230] [email protected](21, "zwlr_output_power_manager_v1", 1)
[4248380.240] [email protected](22, "zwp_input_method_manager_v2", 1)
[4248380.249] [email protected](23, "zwp_text_input_manager_v3", 1)
[4248380.259] [email protected](24, "zwlr_foreign_toplevel_manager_v1", 2)
[4248380.274] [email protected](25, "zwlr_export_dmabuf_manager_v1", 1)
[4248380.284] [email protected](26, "zwlr_screencopy_manager_v1", 3)
[4248380.299] [email protected](27, "zwlr_data_control_manager_v1", 2)
[4248380.309] [email protected](28, "zwp_primary_selection_device_manager_v1", 1)
[4248380.318] [email protected](29, "wp_viewporter", 1)
[4248380.328] [email protected](30, "zwp_virtual_keyboard_manager_v1", 1)
[4248380.338] [email protected](31, "zwlr_virtual_pointer_manager_v1", 2)
[4248380.347] [email protected](32, "zwlr_input_inhibit_manager_v1", 1)
[4248380.357] [email protected](33, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[4248380.371] [email protected](34, "wl_seat", 7)
[4248380.381] [email protected](35, "zwp_pointer_gestures_v1", 1)
[4248380.391] [email protected](39, "wl_output", 3)
[4248380.400] [email protected](40, "wl_output", 3)
[4248380.410] [email protected](41, "wl_output", 3)
[4248380.420] [email protected](2596)
[4248380.425]  -> [email protected](new id wl_callback@3)
[4248380.500] [email protected]_id(3)
[4248380.506] [email protected]("/dev/dri/card0")
[4248380.611]  -> [email protected](6)
[4248380.618] [email protected](808669761)
[4248380.623] [email protected](808669784)
[4248380.628] [email protected](808665665)
[4248380.632] [email protected](808665688)
[4248380.637] [email protected](875713089)
[4248380.642] [email protected](875713112)
[4248380.646] [email protected](909199186)
[4248380.654] [email protected](961959257)
[4248380.658] [email protected](825316697)
[4248380.663] [email protected](842093913)
[4248380.667] [email protected](909202777)
[4248380.672] [email protected](875713881)
[4248380.676] [email protected](842094158)
[4248380.681] [email protected](909203022)
[4248380.685] [email protected](1448695129)
[4248380.690] [email protected](1)
[4248380.695] [email protected](1211384385, 16777215, 4294967295)
[4248380.705] [email protected](1211384408, 16777215, 4294967295)
[4248380.715] [email protected](808669761, 16777215, 4294967295)
[4248380.724] [email protected](808669784, 16777215, 4294967295)
[4248380.734] [email protected](808665665, 16777215, 4294967295)
[4248380.744] [email protected](808665688, 16777215, 4294967295)
[4248380.754] [email protected](875713089, 16777215, 4294967295)
[4248380.763] [email protected](875708993, 16777215, 4294967295)
[4248380.773] [email protected](875713112, 16777215, 4294967295)
[4248380.782] [email protected](875709016, 16777215, 4294967295)
[4248380.792] [email protected](892424769, 16777215, 4294967295)
[4248380.802] [email protected](909199186, 16777215, 4294967295)
[4248380.811] [email protected](538982482, 16777215, 4294967295)
[4248380.821] [email protected](540422482, 16777215, 4294967295)
[4248380.830] [email protected](943215175, 16777215, 4294967295)
[4248380.840] [email protected](842224199, 16777215, 4294967295)
[4248380.849] [email protected](961959257, 16777215, 4294967295)
[4248380.859] [email protected](825316697, 16777215, 4294967295)
[4248380.869] [email protected](842093913, 16777215, 4294967295)
[4248380.878] [email protected](909202777, 16777215, 4294967295)
[4248380.888] [email protected](875713881, 16777215, 4294967295)
[4248380.898] [email protected](961893977, 16777215, 4294967295)
[4248380.907] [email protected](825316953, 16777215, 4294967295)
[4248380.917] [email protected](842094169, 16777215, 4294967295)
[4248380.926] [email protected](909203033, 16777215, 4294967295)
[4248380.936] [email protected](875714137, 16777215, 4294967295)
[4248380.945] [email protected](842094158, 16777215, 4294967295)
[4248380.955] [email protected](808530000, 16777215, 4294967295)
[4248380.965] [email protected](842084432, 16777215, 4294967295)
[4248380.974] [email protected](909193296, 16777215, 4294967295)
[4248380.987] [email protected](909203022, 16777215, 4294967295)
[4248380.997] [email protected](1448433985, 16777215, 4294967295)
[4248381.010] [email protected](1448434008, 16777215, 4294967295)
[4248381.019] [email protected](1448695129, 16777215, 4294967295)
[4248381.029] [email protected](1498831189, 16777215, 4294967295)
[4248381.038] [email protected](2596)
[4248381.044]  -> [email protected](new id wl_callback@3)
[4248381.068] [email protected]_id(3)
[4248381.075] [email protected]()
[4248381.078] [email protected](2596)
[19980:1003/140002.088964:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[19947:1003/140002.112737:ERROR:wayland_window.cc(184)] Not implemented reached in virtual void ui::WaylandWindow::Activate()
[4248416.183] [email protected](1, fd 195, 48238)
[4248417.673] [email protected]_info(25, 600)
[19947:1003/140002.153267:WARNING:render_frame_host_impl.cc(789)] InterfaceRequest was dropped, the document is no longer active: blink.mojom.AppCacheBackend
[4248458.011]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@24)
[4248458.031]  -> [email protected](fd 208, 0, 0, 7680, 16777215, 4294967295)
[4248458.050]  -> [email protected]_immed(new id wl_buffer@25, 1920, 1240, 875708993, 0)
[4248458.123]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@26)
[4248458.133]  -> [email protected](fd 204, 0, 0, 7680, 16777215, 4294967295)
[4248458.151]  -> [email protected]_immed(new id wl_buffer@27, 1920, 1240, 875708993, 0)
[4248458.192]  -> [email protected]_params(new id zwp_linux_buffer_params_v1@28)
[4248458.200]  -> [email protected](fd 206, 0, 0, 7680, 16777215, 4294967295)
[4248458.218]  -> [email protected]_immed(new id wl_buffer@29, 1920, 1240, 875708993, 0)
[19980:1003/140002.157746:FATAL:socket_utils_posix.cc(122)] Check failed: descriptors[i].get() >= 0 (-1 vs. 0)
#0 0x5646f5f6f3c9 base::debug::CollectStackTrace()
#1 0x5646f5ebdc33 base::debug::StackTrace::StackTrace()
#2 0x5646f5ed407f logging::LogMessage::~LogMessage()
#3 0x5646f5ed48fe logging::LogMessage::~LogMessage()
#4 0x5646f62b7973 mojo::SendmsgWithHandles()
#5 0x5646f346ef32 mojo::core::(anonymous namespace)::ChannelPosix::WriteNoLock()
#6 0x5646f346d036 mojo::core::(anonymous namespace)::ChannelPosix::Write()
#7 0x5646f3455e69 mojo::core::NodeChannel::WriteChannelMessage()
#8 0x5646f34567ed mojo::core::NodeChannel::SendChannelMessage()
#9 0x5646f345c368 mojo::core::NodeController::SendPeerEvent()
#10 0x5646f345c93b mojo::core::NodeController::ForwardEvent()
#11 0x5646f7ab6c7e mojo::core::ports::Node::SendUserMessageInternal()
#12 0x5646f7ab6910 mojo::core::ports::Node::SendUserMessage()
#13 0x5646f345a241 mojo::core::NodeController::SendUserMessage()
#14 0x5646f3454338 mojo::core::MessagePipeDispatcher::WriteMessage()
#15 0x5646f3446fba mojo::core::Core::WriteMessage()
#16 0x5646f628ccdc mojo::Connector::Accept()
#17 0x5646f629b61e mojo::internal::MultiplexRouter::InterfaceEndpoint::SendMessage()
#18 0x5646f628fefc mojo::InterfaceEndpointClient::SendMessage()
#19 0x5646f2e3ac17 ui::ozone::mojom::WaylandBufferManagerHostProxy::CommitOverlays()
#20 0x5646f2e02aeb ui::WaylandBufferManagerGpu::CommitOverlaysInternal()
#21 0x5646f2e04298 base::internal::Invoker<>::RunOnce()
#22 0x5646f5f1908b base::TaskAnnotator::RunTask()
#23 0x5646f5f321ac base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#24 0x5646f5f31dd8 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
#25 0x5646f5ed8dd4 base::MessagePumpDefault::Run()
#26 0x5646f5f32a3c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#27 0x5646f5efcfe5 base::RunLoop::Run()
#28 0x5646f9b1ee07 content::GpuMain()
#29 0x5646f4f1674d content::RunZygote()
#30 0x5646f4f17bae content::ContentMainRunnerImpl::Run()
#31 0x5646f3472397 content::RunContentProcess()
#32 0x5646f347248c content::ContentMain()
#33 0x5646f234fa9e main
#34 0x7f07cfaf7152 __libc_start_main
#35 0x5646f2337f6e _start
Task trace:
#0 0x5646f2e028cf ui::WaylandBufferManagerGpu::CommitOverlays()
#1 0x5646f2e32ba4 ui::GbmSurfacelessWayland::SwapBuffersAsync()
#2 0x5646f2e32ba4 ui::GbmSurfacelessWayland::SwapBuffersAsync()
#3 0x5646f7344b59 gpu::Scheduler::RunNextTask()
#4 0x5646f7344b59 gpu::Scheduler::RunNextTask()
Task trace buffer limit hit, update PendingTask::kTaskBacktraceLength to increase.

Received signal 6

Next steps

I've been personally waiting for this for a few years now and with the recent Chromium progress it looks like it's getting really close now.

But there are still a few bugs and issues left and that's why I'm actively monitoring both Chromium and Electron to see if there's anything I can help with to make this happen slightly faster. And judging by the interest in this issue I'm pretty sure there are others who are doing the same which gives me confidence that this might actually be implemented soon.

On the bright side, the Electron 10 patches are currently working great for me and I've been running Visual Studio Code and Slack natively on Wayland without any issues for a few weeks now (although vscode requires a small patch to make it compatible with Electron 10). So until they make their way into the official Electron builds I think that's a great way to run Electron on Wayland currently.

Thanks a lot for all your continued efforts on this.

@vially Quick reminder when upstreaming these patches, including the Chromium build flag RTC_USE_PIPEWIRE=true would enable screensharing with electron apps (MS Teams/Slack/etc.) from Mutter, KDE, and wlroots based compositors.

That flag would actually be useful even while electron is still running in XWayland, but it definitely makes sense to standardize it once Wayland support is upstreamed IMO.

@vially, would you please report the problem to the chromium's bug tracker? thanks.

Sure, I was planning to do that but since I'm not entirely sure it's a Chromium bug I think I'll investigate it a bit more first.

It's entirely possible this is a bug in the Electron Wayland patches or maybe it's something that has been fixed in upstream Chromium already so I want to rule those out before I create a Chromium bug.

Slightly offtopic: I guess you must be aware of it already, but if not it looks like there's currently a regression introduced in Chromium 87.0.4280.11 (which wasn't there in 87.0.4278.0) that prevents Chromium from launching on Wayland: chromium#1136287 (duplicated by #1136252). It's not affecting Electron in any way (or at least not yet) but I just thought I'd mention it in case you haven't seen it and you might be able to help triage it. @msisov

A big thank you to everyone who put time and effort into this! Thanks @msisov and the Igalia folks and thanks @vially.

A precompiled binary is also available with electron-nightly sind a few days for everyone wanting to try this out.


I have not been able to find the RTC_USE_PIPEWIRE=true flag anywhere in this repo. This seems like a logical step for (but not only) wayland applications and desktop environments. Should there be a separate issue for this?

I have not been able to find the RTC_USE_PIPEWIRE=true flag anywhere in this repo. This seems like a logical step for (but not only) wayland applications and desktop environments. Should there be a separate issue for this?

Probably, I was hoping it would be included here. It is a simple fix that can be done at any time. I just recently figured out where it should go (I think), so I'll try to put in a PR tomorrow. Problem is I need time and a sample app to test it.

@danshick I was planning to submit a pull-request for RTC_USE_PIPEWIRE=true too but the only reason I haven't done so already is because I haven't yet been able to make screen-sharing work with chromium on my machine (after enabling the flag). And I didn't want to submit a pull-request for something I can't test.

But it would be great if someone who is able to test this can figure out how to enable it in Electron and submit a pull-request.

But it would be great if someone who is able to test this can figure out how to enable it in Electron and submit a pull-request.

I'll give it a shot and link the PR here when I have time

I'll give it a shot and link the PR here when I have time

Oh man, getting and building electron is a chore. I've got everything pulled, finally, so hopefully I can make the change, build it, and test it in the next couple of days.

Edit: --script-executable=/usr/bin/python2, forgot gn is a python2 stalwart.

Edit2: ...and that still wasn't enough sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py

Edit3: I've been unable to get electron to build, getting errors in unit test file compilation that should be unrelated to the rtc_use_pipewire=true flag. I know it can be done because the electron-ozone package in the AUR includes that flag as an extra arg to gn.

../../components/net_log/net_export_file_writer_unittest.cc:876:22: error: variable type 'net_log::FakeNetworkContext' is an abstract class
  FakeNetworkContext fake_network_context;
                     ^
gen/services/network/public/mojom/network_context.mojom.h:617:16: note: unimplemented pure virtual method 'SetCertVerifierClient' in 'FakeNetworkContext'
  virtual void SetCertVerifierClient(::mojo::PendingRemote<CertVerifierClient> client) = 0;
               ^
1 error generated.
[38912/81310] CXX obj/components/network_time/unit_tests/network_time_tracker_unittest.o
ninja: build stopped: subcommand failed.


For anyone curious, the patch I'm attempting to build is just this...

diff --git a/build/args/release.gn b/build/args/release.gn index e5017f6e1..3ecf23181 100644 --- a/build/args/release.gn +++ b/build/args/release.gn @@ -14,3 +14,6 @@ rtc_use_h264 = proprietary_codecs # who have an LGPL requirement to ship ffmpeg as a dynamically linked library, # we build ffmpeg as a shared library. is_component_ffmpeg = true + +# Enable pipewire support for screen casting on Wayland +rtc_use_pipewire = true diff --git a/build/args/testing.gn b/build/args/testing.gn index 8f62af6e4..db2a7752c 100644 --- a/build/args/testing.gn +++ b/build/args/testing.gn @@ -12,3 +12,6 @@ symbol_level = 1 # The initialization of the decoder depends on whether ffmpeg has # been built with H.264 support. rtc_use_h264 = proprietary_codecs + +# Enable pipewire support for screen casting on Wayland +rtc_use_pipewire = true

I don't know if I should be putting this here, but so far I have electron working under Wayland using electron-nightly and --enable-accelerated-mjpeg-decode --enable-accelerated-video --ignore-gpu-blacklist --enable-native-gpu-memory-buffers --enable-gpu-rasterization --enable-features=UseOzonePlatform --ozone-platform=wayland as launch arguments. There's one thing happening, tho: there are no title bars in any window.

Should I open a new issue or we can discuss it here?

@juxuanu and what compositor are you using? ozone wasn't made to support simpler compositors. if you can reproduce on gnome-shell then it's probably a bug.

@ninja- It's gnome-shell, so Mutter. I guess that we found a bug, then.

Does Electron use server side or client side decorations? GNOME only supports client side.

@juxuanu That's interesting because I am experiencing the same on chromium stable (86.x...) built with ozone. So this does seem like some bug but certainly not a regression from stable. Why do you think this is a bug in Mutter? Every other Wayland native application seem to work on Gnome, except Chromium. That looks more like a Chromium bug than a Mutter bug.

Why do you think this is a bug in Mutter? Every other Wayland native application seem to work on Gnome, except Chromium. That looks more like a Chromium bug than a Mutter bug.

That's because Gnome has decided not to support server-side decorations which means all applications have to draw their own decorations (https://gitlab.gnome.org/GNOME/mutter/-/issues/217).

This means that in order for Electron windows to look "sane" in Gnome either one of these needs to happen:

  • Gnome needs to start supporting server-side decorations (by reading the linked issue, this seems unlikely), or
  • someone needs to add support for client-side decorations in Electron

@vially Oh I think I misread. I thought I was reading Chromium but they were talking about Electron (Because Chromium is doing client-side decoration but I was experiencing some similar issue).

I have thought about this a bit more and considering that Electron is already using GTK for some things maybe it wouldn't be very hard to use GTK for drawing the title bar too when running in GNOME. In case it's useful to someone willing to give this a try, this is what Flutter seems to be doing to conditionally enable the title bar decorations in GNOME.

Personal opinion

I'm not a GNOME user so I don't have a horse in this race, but I still wish GNOME would listen to constructive feedback and reconsider their position on this.

Or maybe libdecoration does eventually get released which might alleviate this problem somewhat. Although I'm not sure if requiring applications to link to yet another library in order to make them run properly in one particular compositor (even if somewhat popular) is the best outcome for this.

Honestly, I'd rather this whole window decoration thing not be implemented in electron. The GNOME developers make a strong stance that "anything not done their way is unsupported", so having to work around that in all client apps just adds complexity to all downstream apps.

If decorations are broken on GNOME because the developers insist "that's the way it should be", then so be it. Trying to work around GNOME bugs keeps bringing issues or inconsistencies to non-GNOME environments.

Enough apps have broken subtleties already in the name of trying to work properly in GNOME. I'd rather effort be put into supporting environments that do care about standardization and cross-DE compatibility.

Chromium already has code to draw the title bar using GTK:
https://chromium.googlesource.com/chromium/src/+/master/ui/gtk/native_theme_gtk.cc#695

On Sat, Nov 14, 2020, 4:22 PM Hugo Barrera notifications@github.com wrote:

Honestly, I'd rather this whole window decoration thing not be
implemented in electron. The GNOME developers make a strong stance that
"anything not done their way is unsupported", so having to work around that
in all client apps just adds complexity to all downstream apps.

If decorations are broken on GNOME because the developers insist "that's
the way it should be", then so be it. Trying to work around GNOME bugs
keeps bringing issues or inconsistencies to non-GNOME environments.

Enough apps have broken subtleties already in the name of trying to work
properly in GNOME. I'd rather effort be put into supporting environments
that do care about standardization and cross-DE compatibility.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/electron/electron/issues/10915#issuecomment-727273382,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAM4YSPJBCV2S5L5GULQVOTSP37J7ANCNFSM4EA2BOCA
.

That's because Gnome has decided not to support server-side decorations which means all applications have to draw their own decorations (https://gitlab.gnome.org/GNOME/mutter/-/issues/217).

This means that in order for Electron windows to look "sane" in Gnome either one of these needs to happen:

* Gnome needs to start supporting server-side decorations (by reading the linked issue, this seems unlikely), or

* someone needs to add support for client-side decorations in Electron

But in the linked bug report someone points out:

This is pretty clear, the XDG decorations spec itself demands decoration support from clients. It also explicitly allows
compositors to disregard the client preference.
That is, a compositor implementation that always uses a mode of client_side in configure events would be perfectly spec-
compliant. Any client that claims support, but doesn't support client-side decorations is not.

So, even if someone thinks it is preferable to use server side decorations, it seems that for a client to be wayland compliant it must support CSD.

This is pretty clear, the XDG decorations spec itself demands decoration support from clients. It also explicitly allows
compositors to disregard the client preference.
That is, a compositor implementation that always uses a mode of client_side in configure events would be perfectly spec-
compliant. Any client that claims support, but doesn't support client-side decorations is not.

FWIW, GNOME does not follow this rule at all. The confirmation button in things like a file picker are considered "decoration", so hiding client decorations hides the main action button.

That said, if the spec is this explicit, then I guess it makes sense for electron to support this.

My only concern is that application developers might end up forgetting to contemplate one or the other alternative -- this much flexibility in the client just sounds like a nice factor for developer to overlook.

There could be a default implemention of client-side decorations that is automatically enabled, and then a opt-out for developers that want to do something more app-specific? Just so folks without server-side decorations at least get some basics?

The core wayland protocol has no concept of decorations, clients should aways draw their own titlebar unless explictly told otherwise (e.g. via xdg_decoration if implemented - and remember a simple return CLIENT_SIDE would be a vaild implementation albeit a pointless one)

I for one would vote to create separate issue for such topics. The initial reason for this issue was providing a wayland build which is now done in the nightly channel. We will surely run into more problems with wayland and discussing each of them in this thread will create a lot of spam.

However regarding the topic of the title bar I will also mention that the issue exists in chrome as well and will likely need to be fixed there as well. To reproduce this open chrome with wayland disabled, right click on the title bar to ensure that "Use system title bar and borders" is enabled. Afterwards restart chrome this time with wayland enabled and you will see that you have no title bar. It is probably best to wait for this to be fixed upstream.

rtc_use_pipewire=true is needed for any Wayland build and I think should be discussed here. @danshick I see was working on it.

rtc_use_pipewire=true is needed for any Wayland build and I think should be discussed here. @danshick I see was working on it.

Not needed, but certainly useful if desktopCapturer is going to work. Enabling that flag has led me to dozens of build errors that I'm swimming through.

I know it is possible to build with that flag as the AUR electron-ozone package has it, but that package segfaults on me any time I try the desktopCapturer API, and I've been unsuccessful modifying that PKGBUILD to retain debugging symbols.

Considering this change seems more involved than just adding the flag and rebuilding, and the fact that it is useful even from XWayland, I think it might be best for a new issue/PR.

I know it is possible to build with that flag as the AUR electron-ozone package has it, but that package segfaults on me any time I try the desktopCapturer API, and I've been unsuccessful modifying that PKGBUILD to retain debugging symbols.

The debugging symbols work for me - this is the likely relevant parts of my makepkg.conf:

#-- Compiler and Linker Flags
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j12"
#-- Debugging flags
#DEBUG_CFLAGS="-g -fvar-tracking-assignments"
#DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
DEBUG_CFLAGS="-g -Og"
DEBUG_CXXFLAGS="-g -Og"

OPTIONS=(!strip docs !libtool !staticlibs emptydirs zipman purge debug)

Thanks @hedgepigdaniel, I tried !strip and debug options, which looked like they were respected in the pkgbuild, but some of these additional compiler flags look useful.

I'd still like to get this building as it should straight out of git, but at least i can diagnose the segfault more immediately.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christiangenco picture christiangenco  ·  3Comments

dangan-ronpa picture dangan-ronpa  ·  3Comments

wsangtoki picture wsangtoki  ·  3Comments

diracdeltas picture diracdeltas  ·  3Comments

ThorstenHans picture ThorstenHans  ·  3Comments