figma-linux icon indicating copy to clipboard operation
figma-linux copied to clipboard

Wayland Support

Open victordiaz opened this issue 3 years ago • 5 comments

Hi! I'm wondering if it would a possibility to bring wayland support to figma-linux. Electron added support from version 12, and from my experience it improved quite a lot in version 13.x.x

Right now I'm using swaywm which is a wayland compositor / window tiling manager.

If I run figma-linux as it is, it runs on a xwayland window where I can feel that the performance drops a lot compared to running Figma on chrome/chromium using the wayland flags as follows

chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --app=http://www.figma.com

I tried to clone figma-linux and run it using the same wayland flags and it runs in natively in wayland using this command

npx electron dist/main/main.js --enable-features=UseOzonePlatform --ozone-platform=wayland

Sadly the current version of electron in figma-linux is version 12 where electron support is not ideal.

Then I tried to quickly upgrade electron to 13.2.2 but after that I get the following error when running it.

❯ App threw an error during load
Error: /home/user/Downloads/figma-linux/node_modules/figma-linux-rust-binding/native/index.node: undefined symbol: _ZN2v811ArrayBuffer11GetContentsEv
    at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
    at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.figma-linux-rust-binding (/home/user/Downloads/figma-linux/dist/main/main.js:5048:18)
    at __webpack_require__ (/home/user/Downloads/figma-linux/dist/main/main.js:767:30)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: /home/user/Downloads/figma-linux/node_modules/figma-linux-rust-binding/native/index.node: undefined symbol: _ZN2v811ArrayBuffer11GetContentsEv
    at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
    at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.figma-linux-rust-binding (/home/user/Downloads/figma-linux/dist/main/main.js:5048:18)
    at __webpack_require__ (/home/user/Downloads/figma-linux/dist/main/main.js:767:30)

From this point I dont know how to continue :D

So basically my question is. Is there a possibility to upgrade electron so figma-linux can obtain proper wayland support for free?

By the way, thanks for the amazing work bringing figma desktop to linux!

victordiaz avatar Aug 25 '21 23:08 victordiaz

@victordiaz Try Release v0.9.6, Roman fixed performance issues via #271, works on Wayland for me.

snarkyalyx avatar Mar 19 '22 20:03 snarkyalyx

It doesn't even launch when trying to use wayland + flatpak.

> flatpak run io.github.Figma_Linux.figma_linux --enable-features=UseOzonePlatform --ozone-platform=wayland
[2 preload-host-spawn-strategy] Running: /app/bin/zypak-helper child - /app/figma-linux/figma-linux --type=zygote

reesericci avatar Apr 10 '22 19:04 reesericci

It doesn't even launch when trying to use wayland + flatpak.

> flatpak run io.github.Figma_Linux.figma_linux --enable-features=UseOzonePlatform --ozone-platform=wayland
[2 preload-host-spawn-strategy] Running: /app/bin/zypak-helper child - /app/figma-linux/figma-linux --type=zygote

Still not working, even with flatpak

oifj34f34f avatar May 11 '23 18:05 oifj34f34f

I try snap and .deb on Wayland, figma-linux v0.10.0 and nothing works

serhumanos avatar Aug 30 '23 22:08 serhumanos

Try this as a workaround: https://github.com/Figma-Linux/figma-linux/issues/345

kentallenduke avatar Nov 06 '23 01:11 kentallenduke