Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with Gtk3 requires X11, and no DISPLAY environment variable is set #104

Closed
ieugen opened this issue Jul 10, 2020 · 8 comments
Closed

Comments

@ieugen
Copy link

ieugen commented Jul 10, 2020

Hi,

I installed the app from https://flathub.org/apps/details/org.gnome.Keysign and I get this:

$ flatpak run org.gnome.Keysign 
Traceback (most recent call last):
  File "/app/bin/gnome-keysign", line 10, in <module>
    sys.exit(main())
  File "/app/lib/python3.7/site-packages/keysign/__init__.py", line 22, in main
    from . import app
  File "/app/lib/python3.7/site-packages/keysign/app.py", line 31, in <module>
    from twisted.internet import gtk3reactor
  File "/app/lib/python3.7/site-packages/twisted/internet/gtk3reactor.py", line 38, in <module>
    "Gtk3 requires X11, and no DISPLAY environment variable is set")
ImportError: Gtk3 requires X11, and no DISPLAY environment variable is set

I was able to fix it by using Flatseal and removing socket=wayland permission.

Linux daos-495 5.7.0-1-amd64 #1 SMP Debian 5.7.6-1 (2020-06-24) x86_64 GNU/Linux
@ieugen ieugen changed the title Failes with Gtk3 requires X11, and no DISPLAY environment variable is set Fails with Gtk3 requires X11, and no DISPLAY environment variable is set Jul 10, 2020
@muelli
Copy link
Member

muelli commented Jul 14, 2020

I remember having seen this before. I also remember that we tried to file a bug against Twisted. I don't remember, though, whether we succeeded. Have you tried to file a bug?

@ieugen
Copy link
Author

ieugen commented Jul 14, 2020

Hi,

No, I filed a bug here because this is the version I installed.
I don't know anything about Twisted.
I hope this helps someone find a solution or at least a workaround.
A simple thing could be to disable socket=wayland on default install.

@muelli
Copy link
Member

muelli commented Jul 14, 2020

yeah, I see. Thanks for documenting a way to make it work.

This is a bug in Twisted, though. Disabling the Wayland socket is only a mildly entertaining workaround that will break down once Wayland is popular enough to warrant enabling it again.
So the Twisted people will need to be made aware of this problem.
@RyuzakiKK do you remember whether and what we did?

@RyuzakiKK
Copy link
Member

yeah, I see. Thanks for documenting a way to make it work.

This is a bug in Twisted, though. Disabling the Wayland socket is only a mildly entertaining workaround that will break down once Wayland is popular enough to warrant enabling it again.
So the Twisted people will need to be made aware of this problem.
@RyuzakiKK do you remember whether and what we did?

The bug was this one flathub/org.gnome.Keysign#14
In the end I think that nobody opened yet the bug upstream against Twisted.

muelli added a commit to flathub/org.gnome.Keysign that referenced this issue Jul 23, 2020
Our dependency, Twisted, is not compatible with Wayland:
gnome-keysign/gnome-keysign#104 and
https://twistedmatrix.com/trac/ticket/9904.
Since we currently cannot run with Wayland, we disable the socket.
This leaves the bug about not being able to run in a Wayland-only
session, but that's a bug for Twisted to solve.
@muelli
Copy link
Member

muelli commented Jul 23, 2020

the upstream bug is https://twistedmatrix.com/trac/ticket/9904
I wonder whether reverting the offending commit, twisted/twisted@4142aee, would work. hm.

@muelli
Copy link
Member

muelli commented Sep 10, 2020

I have tested on a Wayland session and it seems as if the DISPLAY variable doesn't matter when run under pure Wayland. Reverting the whole commit seems like a bit too big, but at least the offending test can be patched out.

For the flathub build, we could write a small wrapper that sets the variable in case it is not set.

@muelli
Copy link
Member

muelli commented Sep 10, 2020

twisted/twisted#1379

@muelli
Copy link
Member

muelli commented Apr 12, 2023

I believe this is fixed since Twisted does not raise this error any more.

@muelli muelli closed this as completed Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants