Under Ubuntu 22.04 but i think the problem is more general any FLTK application appear in the Appmenu as 'FLTK'
I don't know if there is a correct way to manage it,
I managed to fix this using :
void set_wm_class(Fl_Window *window, const char *res_name, const char *res_class) {
Display *display = fl_display; // Get the display used by FLTK
Window xid = fl_xid(window); // Get the XID (Window ID) of the FLTK window
XClassHint *class_hint = XAllocClassHint();
if (class_hint) {
//class_hint->res_name = const_cast<char*>(res_name);
class_hint->res_class = const_cast<char*>(res_class);
XSetClassHint(display, xid, class_hint);
XFree(class_hint);
}
}
and calling it after the window creation with:
set_wm_class(window, "app-name", "RequiredAppName");
It is still a bit annoying because the application starts as FLTK in the app menu and then switch to the requested name, plus I'm not sure it is a clean way to fix the problem
Any suggestion?