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

Wayland integration broken with Wlroots/Sway compositor #72

Open
nostdm opened this issue Aug 11, 2019 · 7 comments
Open

Wayland integration broken with Wlroots/Sway compositor #72

nostdm opened this issue Aug 11, 2019 · 7 comments

Comments

@nostdm
Copy link

nostdm commented Aug 11, 2019

FreeGLUT version: 2019/06/07 012936e
OS: Arch Linux 5.2.6-arch1-1-ARCH
Compositor Sway version 1.1-rc1-87-g8ee054b1 (Aug 1 2019, branch 'master')

I compiled freeglut from the git_master branch using the -DFREEGLUT_WAYLAND=ON option.

I then wanted to build the mupdf-gl program which depends on freeglut to draw the window, but when I ran mupdf after installation the freeglut library returned an error: failed to discover all needed compositor interfaces.

Looking at the related wayland code, it returns an error when either compositor, shell, seat or shm are NULL, but I'm not sure why it fails to initialize: https://github.com/dcnieho/FreeGLUT/blob/git_master/freeglut/freeglut/src/wayland/fg_init_wl.c#L96

@jtsiomb
Copy link
Member

jtsiomb commented Oct 18, 2019

I see that in the other bug report linked above, you mentioned that you opened this issue and nobody responded. Just posting to let you know that this is not the official freeglut bug tracker. The official freeglut bug tracker is on sourceforge, and if you want to increase your chances of people seeing this, it's best if you also post on the freeglut-developer mailing list.

Having said that. I usually do most of the UNIX-side-of-things hacking on freeglut, and I have no idea (nor interest) at all about wayland. So unless you post in the aforementioned mailing list and the original contributor of the freeglut wayland code responds, I'd say your best bet is to fix the issue yourself, prepare a patch, and send it to us.

@jtsiomb
Copy link
Member

jtsiomb commented Oct 18, 2019

I looked through the old emails, and it seems like @Tarnyko was the one who contributed the wayland code. Pinging him just to see if he has something to add to this discussion :)

@Tarnyko
Copy link
Contributor

Tarnyko commented Oct 19, 2019

@nostdm @jtsiomb Wow, this is (AFAIC) old stuff...
I'm not sure anymore why I check for shm, given that this is normally only needed for unaccelerated drawing (OpenGL only needs wl_egl). Maybe wlroots doesn't expose it.
shell was also being proposed for removal, in favor of more specialized interfaces like xdg_shell. Need to check, too.
Core point is, I was making it compatible with Weston 1.4.0 back at the time. A working Wlroots setup is needed to check. But I can't promise how quick it will be, neither if I can do it in reasonable time (my dev topics have shifted a lot).

@troubas
Copy link

troubas commented Mar 17, 2020

I've found out that fgDisplay.pDisplay.shell is NULL and because of that the initialization fails.
Because I haven't played around with development of wayland or freeglut as of yet I'm finding it difficult to continue. I've tried removing the shell dependency and have been able to prevent mupdf from crashing but it doesn't open a window so that's not quite it.
I doubt I'll get around to read up on the wayland protocol atm but I'd also be interested in a fix. Maybe I'll create an xdg-shell based application to get the basics and then I might be able to provide a patch for freeglut. But lots of maybes, lots of work and little time =)

@Tarnyko
Copy link
Contributor

Tarnyko commented Apr 1, 2020 via email

@troubas
Copy link

troubas commented Apr 2, 2020

Thank you, this is indeed the direction I've been taking. It's not quite as simple as replacing all wl_shell instances with xdg_shell. I think there isn't even such a type.
Instead one creates xdg_surface directly from wl_surface and then has to further specify the type of surface to create.

But I haven't gotten much further then setting up my build environment. I'll post again when I make progress or if I decide to give up due to missing time.

@sl1pkn07
Copy link

sl1pkn07 commented Feb 27, 2023

tested in Kwin with wayland. same as op

failed to discover all needed compositor interfaces. tested all the freeglut demos

greetings

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

5 participants