<div dir="auto">EGL is the way to go for Linux on Wayland and X11. <div dir="auto"><br></div><div dir="auto">I don't know how to do it yet, but it seems the solution is to use DMABUF with EGL and share it with GTK (I suspect on a GtkGLArea widget, but not sure yet).</div><div dir="auto"><br></div><div dir="auto">Firefox and WebKit GTK uses the same technic.</div><div dir="auto"><br></div><div dir="auto">Gtk4 does not allow application painting, so direct surface context is not possible.</div><div dir="auto"><br></div><div dir="auto">We are using gtk3 and it is still possible, but I want to use GtkHeaderbar and clean up glass code. Since it means sharing the window/surface with GTK, direct surface rendering also doesn't work.</div><div dir="auto"><br></div><div dir="auto"><a href="https://mozillagfx.wordpress.com/2021/10/30/switching-the-linux-graphics-stack-from-glx-to-egl/">https://mozillagfx.wordpress.com/2021/10/30/switching-the-linux-graphics-stack-from-glx-to-egl/</a></div><div dir="auto"><br></div><div dir="auto"><a href="https://blogs.igalia.com/carlosgc/2023/04/03/webkitgtk-accelerated-compositing-rendering/">https://blogs.igalia.com/carlosgc/2023/04/03/webkitgtk-accelerated-compositing-rendering/</a></div><div dir="auto"><br></div><div dir="auto"><a href="https://blog.gtk.org/2021/05/10/adventures-in-graphics-apis/">https://blog.gtk.org/2021/05/10/adventures-in-graphics-apis/</a></div><div dir="auto"><br></div><div dir="auto">It's been nice to learn.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em seg., 16 de out. de 2023 20:51, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><div><br></div><div>I am investigating about prism on Wayland.</div><div><br></div><div>It looks like we could just replace the GLX calls on X11 backend to EGL and it will work on both (maybe rename it).<br></div><div><br></div><div>It will need some work to pass the native display around - it assumes X11 Display everywhere and it could be a Display or a wl_display.</div><div><br></div><div>-- Thiago.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em dom., 15 de out. de 2023 às 16:06, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank" rel="noreferrer">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><div><br></div><div>Update: It now works on wayland with -Dprism.order=sw</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em dom., 15 de out. de 2023 às 10:49, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank" rel="noreferrer">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><div><br></div><div><a href="https://github.com/openjdk/jfx-sandbox/tree/tsayao_wayland" target="_blank" rel="noreferrer">https://github.com/openjdk/jfx-sandbox/tree/tsayao_wayland</a><br></div><div><br></div><div>I did some experiments here. So far, so good.</div><div><br></div><div>1) Replaced GDK events for Gtk Signals - It's the way to go for newer gtk.</div><div>2) Replaced drawing directly in the window and added a GtkDrawingArea with a GtkHeaderBar which allows control over the whole window</div><div>size and allows to get rid of extents* calls - this cleans up a lot.</div><div>3) Unified the WindowContext to clean it up.</div><div><br></div><div>I also integrated the IME replacement proposed here:</div><div><a href="https://github.com/openjdk/jfx/pull/1080" target="_blank" rel="noreferrer">https://github.com/openjdk/jfx/pull/1080</a><br></div><div><br></div><div>It almost runs with software rendering on Wayland, but something still touches X11.<br></div><div><br></div><div><div>To finally make it work on Wayland it requires to implement it on prism es2. I see that there's a EGL part of Monocle. I still don't completely understand it, but wouldn't it work as a drop-in replacement? </div><div><br></div></div><div>-- Thiago.</div><div><br></div><div><br></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>