Wayland / Linux not working (fixed)

Bug report

Inkdrop does not run with Wayland under Linux.

$ inkdrop
(inkdrop:163228): Gtk-WARNING **: 19:57:47.587: cannot open display: :0

Info

  • Platform: Ubuntu
  • Platform version: 20.04
  • App Version: current Snap version

Reproduce

Run with Wayland session.

Hi Marco,

Thank you for the report.
Unfortunately, Electron does not support Wayland at the moment.

This is odd as I don’t have problems with other electron apps (Wire, VS Code, Slack, Joplin for example).

Maybe they have some patch but I can’t find that Electron supports it out of the box right now.
Or you are missing something on how you run the app.

Found the same issue on another app, the same conclusion that we have to wait for Electron to support Wayland:

It seems more like a problem when Electron apps are packaged as a Snap.

There is a fix mentioned here (https://github.com/sindresorhus/caprine/issues/1006):
https://github.com/electron-userland/electron-builder/commit/2278c2a

Btw: The Snap version of Insomnia works on Wayland nowadays (just tried it).

Thank you! I’ll try it.

I added DISABLE_WAYLAND=1 env variable to the snapcraft.
Could you try it?:

$ sudo snap install --edge inkdrop

The package build number is 30.

1 Like

It works - great, thank you.
Now also Fedora users where Wayland is the default could use it :slight_smile:

1 Like

Cool!! Thank you for letting me know :smiley:
Cheers

I’ve been running it on Wayland on Arch and I did not have to set that environment variable. :thinking:

Takuya added it in the electron build process. It’s not a variable a user has too add. This shouldn’t be an issue anymore.

I ran into a similar problem in Manjaro.
I was able to run Fcitx5 at Wayland in Manjaro and will share how.

Please let me know if this method is deprecated :bowing_woman:

My Environment

Operating System: Manjaro Linux 
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.6.34-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 12 × 12th Gen Intel® Core™ i5-1235U
Memory: 23.2 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: LENOVO
Product Name: 21E3CTO1WW
System Version: ThinkPad E14 Gen 4

I couldn’t type Japanese with Inkdrop installed from snap, Wayland was the culprit.
The input method used is Fcitx5-skk.
Inkdrop was installed from AUR.
I have never used Ubuntu and do not know if a system like AUR exists. Sorry…

You will find inkdrop.desktop in /usr/share/applications. Edit this.

[daiki:/usr/share/applications]
$ sudo nvim inkdrop.desktop

Edit the value of Exec.

[Desktop Entry]
Name=inkdrop
Comment=The Note-taking App with Robust Markdown Editor
GenericName=inkdrop
Exec=inkdrop %U               # Here
Icon=inkdrop
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;
MimeType=x-scheme-handler/inkdrop;

Added --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime .

...
GenericName=inkdrop
Exec=inkdrop --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime %U
Icon=inkdrop
...

This way I was able to get Fcitx5 to work within Inkdrop on Wayland.

Ref

1 Like

Hey Daiki-san,

Thanks for the report!

I’m not sure if I should add these options by default. :thinking:

1 Like

This would be useful if there are many Wayland users :+1:
For Arch Linux, Wayland’s Electron support was specified to use command line flags.
https://wiki.archlinux.org/title/Wayland#Electron

I think it could be added by default if the Arch users of Inkdrop want it. However, it can cause unnecessary glitches.
Therefore, how about writing an example of using Inkdrop in Wayland in the official documentation?
Each distribution may require a different response.

I would like to see Electron officially support Wayland…

1 Like

Added it in the docs. Thanks again!

1 Like