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

glfw: Wayland Compilation causes Platform Error in runtime #146

Closed
alichraghi opened this issue Dec 24, 2021 · 4 comments
Closed

glfw: Wayland Compilation causes Platform Error in runtime #146

alichraghi opened this issue Dec 24, 2021 · 4 comments
Labels
bug Something isn't working glfw help welcome
Milestone

Comments

@alichraghi
Copy link
Contributor

im not able to run a simple example of mach-glfw build for wayland target.

error description:

error: PlatformError
Wayland: Focusing a window requires user interaction

not sure this only happen in my system or it's a global issue

@slimsag
Copy link
Member

slimsag commented Dec 24, 2021

Wow, apparently createWindow returns an error that should be ignored on Wayland:

glfw/glfw#1121

See also bnpr/Malt#173

Seems to be because focusOnShow window hint defaults to true in GLFW: https://sourcegraph.com/github.com/glfw/glfw@3.3.6/-/blob/src/window.c?L270:24

Looks like the error is removed in the latest master version of GLFW, though. I suspect real fix is just to wait until new GLFW version is released.

Workaround: We should force focusOnShow to default to false if Wayland.

@slimsag slimsag changed the title Wayland Compilation causes Platform Error in runtime glfw: Wayland Compilation causes Platform Error in runtime Dec 25, 2021
@slimsag slimsag added bug Something isn't working glfw help welcome labels Jan 9, 2022
@illfygli
Copy link

illfygli commented Jun 5, 2022

I get a different PlatformError when I try to run a demo:

glfw: error.PlatformError: X11: The DISPLAY environment variable is missing
error: PlatformError

using Sway WM on Arch.

@slimsag slimsag added this to the Mach 0.2 milestone Sep 1, 2022
@alichraghi
Copy link
Contributor Author

zig build run-example-boids on wayland worked as expected. upstream issue is also closed so we can close this too

@slimsag
Copy link
Member

slimsag commented Sep 2, 2022

Closing, but please note this doesn't mean Wayland is fully working @alichraghi - the reason that boids example works on your system is most likely because you have XWayland which adds X11 compatibility for Wayland.

#511 describes what we need to do next to get proper Wayland support.

@slimsag slimsag closed this as completed Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working glfw help welcome
Projects
None yet
Development

No branches or pull requests

3 participants