simonkrauter / NiGui

Cross-platform desktop GUI toolkit written in Nim
MIT License
724 stars 49 forks source link

cannot open display: :1 #30

Closed Hammer2900 closed 5 years ago

Hammer2900 commented 5 years ago

compile standard example on Ubuntu 18.04.1 LTS and get error, cannot open display: :1 , how can i fix it ?cannot open display: :1

simonkrauter commented 5 years ago

I tried to reproduce this, but wasn't successful. It works for me in a fresh installation of Ubuntu 18.04.1 LTS and with Nim 0.19.2 screenshot_2019-01-19_16-38-05

I have no idea, where the error message comes from. NiGui does nothing related to "display".

ghost commented 5 years ago

@Hammer2900 are you sure you are using Xorg, or, with Wayland, you have XWayland installed? Otherwise NiGui wouldn't work since it does not natively support Wayland yet.

simonkrauter commented 5 years ago

@Yardanico Can you please explain this more? Why does NiGui need Xorg? NiGui uses the higher level Gtk.

Hammer2900 commented 5 years ago

I understand, yes i use Wayland =(

0xACE commented 5 years ago

@trustable-code I'm not familiar with wayland yet, but my best guess is that gtk3 is compiled with dependencies from xorg/X11.

Essentially Xorg or uses the DISPLAY environment variable to know which xorg instance it should render on.

$ DISPLAY=:0 gvim & # this client will be visible in session :0
$ DISPLAY=:1 gvim # this client will be visible in session :1

And in this case: gtk is trying to connect to a DISPLAY which doesn't exist or he lacks authorization to use.

Maybe it is possible to compile gtk3 without Xorg dependencies, but then the reverse problem would happen for Xorg users and as of yet I'm not familiar with a Wayland to Xorg proxy, but I have heard of existing implementations of Xorg to Wayland proxies.

I hope this helps :-)

simonkrauter commented 5 years ago

This is not an issue of NiGui. Closing.