Hybrid Wayland/X11 platform

29 views
Skip to first unread message

Manolo

unread,
Aug 29, 2022, 6:39:02 AM8/29/22
to fltk.coredev
Hi devs,

I'd like to give here some information about a recent commit (c720aae) to the FLTK main branch which was done in agreement with Albrecht.

The commit's purpose if to create what can be called a hybrid Wayland/X11 platform.

Resulting FLTK executables will manage their windows with Wayland if Wayland is available at run-time, and will fallback to using X11 if it's not. An environment variable can also be used to force one or another of these outcomes.

The Wayland leg of this 2-legged platform is identical to what was produced by option OPTION_USE_WAYLAND before this commit.

The X11 leg of this 2-legged platform differs somewhat from the regular X11 platform in that it uses Cairo for all its drawing and Pango for all text.

In practical terms, the hybrid platform puts both X11-platform and Wayland-platform code inside libfltk and libfltk_gl.

We, Albrecht and I, believe this is a much stronger way to introduce Wayland support into FLTK since it reproduces what the GTK GUI toollkit does, to support both Wayland and X11-based windowing in the same app.

Comments welcome.

Mo_Al_

unread,
Aug 29, 2022, 12:38:56 PM8/29/22
to fltk.coredev
This is great news. Thanks for your effort. I tried it and it works well. One hiccup I noticed:
In a program compiled with OPTION_USE_WAYLAND, if the program is started with FLTK_BACKEND=x11, calls to Fl::background(uchar, uchar, uchar) seem to be ignored. I'm not sure why that happens, I tried tracking the FLTK_BACKEND code:
```
  else if (backend && strcmp(backend, "x11") == 0) {
    return new Fl_X11_System_Driver();
  }
```
So the issue might be somewhere else. 

Manolo

unread,
Aug 30, 2022, 2:19:28 AM8/30/22
to fltk.coredev
Le lundi 29 août 2022 à 18:38:56 UTC+2, may64...@gmail.com a écrit :
One hiccup I noticed:
In a program compiled with OPTION_USE_WAYLAND, if the program is started with FLTK_BACKEND=x11, calls to Fl::background(uchar, uchar, uchar) seem to be ignored.
Thanks for this report.
That problem should be fixed now in the git repo.
Reply all
Reply to author
Forward
0 new messages