Sorry I really don't understand what is going on. What I expect is simply causing this GTK libdecor plugin to *exist* on your machine would cause it to be used. There absolutely should not be any need to recompile fltk. And I would think the option "USE_SYSTEM_LIBDECOR" is irrelevant, as either the code in fltk or the code in the shared library should load the plugin. Can anybody explain just what is happening here?
Today, the code for GTK-style titlebar drawing exists only as Merge Request #43 to the gitlab repository of libdecor.
We just can't expect any FLTK user to have it in the form of a shared library on her computer.
In order for me, and others, to see how it works and whether FLTK is ready to draw window titlebars with it,
I have downloaded the code and copied to <fltk source tree>/libdecor the single relevant change,
the new file libdecor/src/plugins/gtk/libdecor-gtk.c. I have further arranged for FLTK to use this code
instead of the previous in libdecor/src/plugins/cairo/libdecor-cairo.c to draw titlebars.
That is the solution I found that is compatible with the present state of this new piece of code.
In the future :
1) hopefully, Merge Request #43 will be accepted by libdecor's author and merged into the libdecor master
branch;
2) at some time point later, the libdecor Linux packages will be updated following libdecor's update
and FLTK users will be able to turn ON OPTION_USE_SYSTEM_LIBDECOR and rebuild FLTK
and get the same result, GTK-styled window titlebars.
This solution allows FLTK to get the final result without having to wait for these events.
We can plan to, when the libdecor package and its GTK plugin will be available to Linux systems,
make OPTION_USE_SYSTEM_LIBDECOR be ON by default and to make libdecor a recommended
dependance of the Wayland platform of FLTK.