Re: Exploration: FLTK platform compatible with both Wayland and X11
Bill Spitzak
Mar 31, 2022
Yes, that is what I think is correct. "Wayland support" pretty much requires "Wayland + X11 support" as Wayland-only is not going to work in too many situations and is a pita for the user if they have to run in both. But absolutely as much code should be shared as possible, which means they should both use Cairo, I would also make X11 draw into a local buffer (not sure how this gets done) as this matches how it works on Wayland, and is much faster.
I'm also wondering if there are tricks that could be used to get the windows positioned using the Xlib api, while using Cairo for everything else.
It's of course necessary to maintain in FLTK 1.4 an X11-only version of the code. That's necessary for relatively old systems because Wayland requires recent Linux versions. That's also necessary for Unix-but-not-Linux systems (e.g., NetBSD, FreeBSD, Darwin) because there's no Wayland outside Linux at this point.
One possibility to be considered could be as follows:
FLTK 1.4 would propose two "platforms" for Unix systems
1) the X11 platform, as it's now in the git repo. It would be usable on a large set of systems, Linux or Unix, old or new, Darwin, Cygwin.
2) a new in 1.4 platform which would be for recent Linux systems only, and would be a hybrid library with Wayland and X11 backends. Both backends would draw with Cairo and use Pango for text. That would be a merge of the present wayland and display-cairo branches. Maintainers of the FLTK packages in Linux distributions could be told to consider using this platform for FLTK 1.4 and above.
It would be produced with OPTION_USE_WAYLAND under CMake or with ./configure --enable-wayland
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.