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

Blender Launcher crashes during init on Gnome under Wayland #47

Open
johnyc90 opened this issue Jan 4, 2024 · 7 comments
Open

Blender Launcher crashes during init on Gnome under Wayland #47

johnyc90 opened this issue Jan 4, 2024 · 7 comments

Comments

@johnyc90
Copy link

johnyc90 commented Jan 4, 2024

Describe the bug
Blender launcher is not lauching on Fedora systems under gnoe wayland. Running it through the terminal yields the following messages:

Traceback (most recent call last):
  File "main.py", line 9, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
  File "windows/main_window.py", line 29, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
  File "pynput/__init__.py", line 40, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
  File "pynput/keyboard/__init__.py", line 31, in <module>
  File "pynput/_util/__init__.py", line 76, in backend
ImportError: this platform is not supported: ('failed to acquire X connection: Can\'t connect to display ":0": b\'Authorization required, but no authorization protocol specified\\n\'', DisplayConnectionError(':0', b'Authorization required, but no authorization protocol specified\n'))

Try one of the following resolutions:

 * Please make sure that you have an X server running, and that the DISPLAY environment variable is set correctly
[12069] Failed to execute script 'main' due to unhandled exception!

To Reproduce
Steps to reproduce the behavior:

  • Using a Fedora version 37 or up, logged using Gnome Wayland.
  • Open a terminal window.
  • Navigate to the Blender Launcher

Expected behavior
For Blender Laucher to run.

System (please complete the following information):

  • Operation system: Fedora 37/38/39
  • Blender Launcher version: any

Additional context
This problem had been reported on Dotbow's repo previously. This is sure to happen on Fedora versions newer than 36 unsing gnome and wayland, but other people have had this same problem under other OSs. This seemed to be related to how Gnome versions 43 where using GTK4 toolkit under wayland or something like this, so I think that anything running Gnome 43 and over under wayland might display the issue.

@zeptofine
Copy link
Collaborator

I guess pynput requires an X server (or xwayland) to be running. I'll see if that can possibly be made optional

@johnyc90
Copy link
Author

johnyc90 commented Jan 6, 2024

Apparently pyinput should work under wayland. But the build_linux.sh and build_linux_debug.sh files point to hidden-imports of _xorg files:

--hidden-import "pynput.keyboard._xorg"
--hidden-import "pynput.mouse._xorg"
--hidden-import "python-xlib" \

Is it possible that the linux version is explicitly using the xorg versions of those dependencies instead of a platform agnostic version?

@zeptofine
Copy link
Collaborator

The packager needs to use these hidden imports because they aren't static, so pyinstaller cannot track them. see here: moses-palmer/pynput#312

and during importing, pynput uses this function, where in the highlighted text, specifies which modules to use:
image

And I think a fully platform agnostic version is impossible because it needs different methods of collecting keystrokes for different oses. pynput.keyboard's version of platform agnostic is selecting the correct backend during runtime

image

The XLib import seems to have been added actually for Fedora... not sure why though

@johnyc90
Copy link
Author

johnyc90 commented Jan 6, 2024

After doing some digging I built it myself at home and I got a functioning version of the launcher. I suppose it may be related to the build environment.
One thing I noticed is that while installing the dependencies through pdm, the installation of evdev (the pynput dependency that is used to solve wayland compatibility) fails to install. This was due to missing the required distro's python development package (python3.10-devel in my case since 3.10 is the python version i'm using). After that everything went smooth.
There was a separate bug that issued, with python complaining about unexpected floats, but I'll make a separate issue for that.

@zeptofine
Copy link
Collaborator

zeptofine commented Jan 6, 2024

strange, i thought i fixed that last thing. Could you be more specific?

@johnyc90
Copy link
Author

johnyc90 commented Jan 7, 2024

Oh! you fixed it on commit c2ed648.

@zeptofine
Copy link
Collaborator

ok, now I'm curious, does the global hotkeys actually work for you on Wayland with the custom build? it has never worked for me on Wayland. I always assumed it was because of the security stuff regarding Wayland

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

2 participants