question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot create Window on Wayland

See original GitHub issue

Tried this on Ubuntu 18.04, with Wayland (before logging in, select Wayland via the little menu next to the unlock button), and installing the glfw lib via sudo apt install libglfw-wayland.

This simple example fails:

import glfw
glfw.init()
# glfw.ERROR_REPORTING = False
w = glfw.create_window(640, 480, "glfw window", None, None)

Traceback:

Traceback (most recent call last):
  File "<tmp 1>", line 4, in <module>
    w = glfw.create_window(640, 480, "glfw window", None, None)
  File "/home/almar/.local/lib/python3.6/site-packages/glfw/__init__.py", line 1141, in create_window
    monitor, share)
  File "/home/almar/.local/lib/python3.6/site-packages/glfw/__init__.py", line 609, in errcheck
    _reraise(exc[1], exc[2])
  File "/home/almar/.local/lib/python3.6/site-packages/glfw/__init__.py", line 45, in _reraise
    raise exception.with_traceback(traceback)
  File "/home/almar/.local/lib/python3.6/site-packages/glfw/__init__.py", line 588, in callback_wrapper
    return func(*args, **kwargs)
  File "/home/almar/.local/lib/python3.6/site-packages/glfw/__init__.py", line 800, in _raise_glfw_errors_as_exceptions
    raise GLFWError(message)
glfw.GLFWError: (65544) b'Wayland: Focusing a window requires user interaction'

If I uncomment the line to ignore errors, it works, except the window is undecorated.

Some context: https://github.com/glfw/glfw/issues/1121 seems to suggest that the error is more of a warning? See also these.

It looks like PyGLFW checks if there are errors and raises them as Python exceptions. Perhaps there should be a filter to ignore specific exceptions like this one?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:27 (17 by maintainers)

github_iconTop GitHub Comments

4reactions
FlorianRhiemcommented, Jan 16, 2020

Yes, that keeps backwards compatibility and gives users plenty of options. I’ve added more ERROR_REPORTING options in 8904cbf64e5fe656c898525fc2442a7385609dab:

  • True, 'raise' or 'exception': raise an exception
  • 'warn' or 'warning': issue a warning
  • 'log': log to the ‘glfw’ logger on debug level
  • 'ignore' or False: do nothing
  • anything else: raise a ValueError about the invalid value of ERROR_REPORTING, including the GLFW error in the message.
2reactions
einarfcommented, Jan 21, 2020

@FlorianRhiem deserves a medal or something. It’s the truth.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FSLeyes cannot create window (under wayland) #45 - GitHub
I am trying to launch FSLeyes, and I get a failure from wxGTK, any idea what's going on? chymera@silenthost ~ $ fsleyes Traceback...
Read more >
Firefox on Gnome 42 Wayland can't create new window after ...
I've been having this super annoying issue after gnome 42(I think). I'm using firefox with "MOZ_ENABLE_WAYLAND=1".
Read more >
Allow raising application accessory windows under Wayland
Problem: When an application with multiple windows (main window + accessory utility windows) wants to change focus to the accessory window, we ...
Read more >
Creating a Window - The Smithay Handbook
We can create a Window by using the Environment::create_window() method. ... by the Wayland server, so you cannot rely on it, you need...
Read more >
[SOLVED] Gnome, Wayland and Wine / Newbie Corner / Arch ...
So I tried to start winecfg but it doesn't start either! err:process:init_windows_dirs directory L"C:\\windows" could not be created, error 2 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found