On Mon, 8 Dec 2025 22:03:07 +0100 ichthyo <[email protected]> wrote:
Anyway, the problem is glaringly obvious

WidgetPDial.cpp, line 195

cairo_surface_t* Xsurface = cairo_xlib_surface_create
                              (fl_display, fl_window, fl_visual->visual,
                               Fl_Window::current()->w() * scale,
                               Fl_Window::current()->h() * scale);


This *can* not work under Wayland.

...please have a look on my 'stripdown' branch. The latest Commit does not
crash, because I have replaced that code by a simple super-call.
On 09/12/2025 10:09, Will Godfrey wrote:
Yes, as soon as you *see* this it's quite obvious really. I suppose, as a very
temporary work round, we could check whether running under wayland and if so
do that simple draw. This gives us a dilemma though. How can we restore
a nice looking control (which has almost become a meme for Yoshimi)?

(....) I do remember though that cairo doesn't care what 'surface' you draw
on,...



Hi Will,

indeed, that is the whole point with Cairo. You "somehow" get a *surface*,
and then you can use that generic capabilities of the library to draw
in a way that is essentially independent of the underlying technology.

Cairo is in widespread use in modern UI toolkits, and thus we can assume
that it has adopted support for Wayland since a long time. We just have
to figure out (for the yoshimi project) how to achieve that step.

A quick internet search I did yesterday turned up the following:
https://jan.newmarch.name/Wayland/Cairo/

A good introduction into Cairo concepts and usage is here
https://www.cairographics.org/tutorial/


As you probably know, this summer we researched a related topic
for the Lumiera project (how to display video frames from a C++ desktop
application). Benny and me did a talk at FrOSCon (if I recall right,
you had watched the video).

Anyway, below pretty much any desktop graphics, today the underlying
technology is OpenGL, in the "modern" variant, with custom programmed
shaders. And there is a library called "EGL", which is used almost
everywhere to get a drawing surface. In the old days, under X-Server,
we used the library "GLX" for the same purpose...

I have collected some notes and links from the preparation of my talk,
see here for "EGL"
https://lumiera.org/research/videoDisplay/description.html#_acquire_a_surface_via_egl


But what we need to research and figure out now is the question:
"how is that achieved properly *under FLTK*". I would be surprised
if there is not already some established standard procedure to
get an EGL surface for a FLTK widget for custom drawing.
If we have solved that, then we can pass that to cairo and
get a cairo surface, and then we can continue to use our
existing code (I'd expect that the drawing code itself
does not need to be changed in any way).

-- Hermann






_______________________________________________
Yoshimi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to