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
Comments
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. |
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 :) |
@nostdm @jtsiomb Wow, this is (AFAIC) old stuff... |
I've found out that |
This was intended to work with at least Weston and GNOME :
pDisplay->shell = wl_registry_bind ( registry, id,
&wl_shell_interface, 1 );
It the compositor does not try to be backwards-compatible, but insists on
being "cutting-edge", consider this :
#include "xdg-shell-client-protocol.h"
#include "xdg-shell-unstable-v6-client-protocol.h"
struct xdg_shell* _xdg_shell = NULL;
struct zxdg_shell_v6* _zxdg_shell_v6 = NULL;
else if (!strcmp(interface, "xdg_shell"))
xdg_shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(_xdg_shell, XDG_VERSION);
else if (!strcmp(interface, "zxdg_shell_v6"))
_zxdg_shell_v6 = wl_registry_bind(registry, id, &zxdg_shell_v6_interface,
1);
You will also need to replace all the "wl_shell" calls to "xsg_shell"
corresponding ones. Without them, no window can be shown/resized (as the
shell is the abstraction for the window manager).
troubas writes:
… 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 =)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#72 (comment)
|
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. 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. |
tested in Kwin with wayland. same as op
greetings |
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 onfreeglut
to draw the window, but when I ranmupdf
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
orshm
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#L96The text was updated successfully, but these errors were encountered: