Index: src/hid/common/hidinit.c =================================================================== --- src/hid/common/hidinit.c (revision 484) +++ src/hid/common/hidinit.c (revision 485) @@ -188,7 +188,6 @@ for (i = 0; i < hid_num_hids; i++) if (!hid_list[i]->printer && !hid_list[i]->exporter && !strcmp(hid_list[i]->name, preference)) return hid_list[i]; - Message("Error: can't find gui '%s' (requested by the user)\n", preference); return NULL; } Index: src/main.c =================================================================== --- src/main.c (revision 484) +++ src/main.c (revision 485) @@ -81,7 +81,6 @@ #define PCBLIBPATH ".:" PCBLIBDIR - #ifdef HAVE_LIBSTROKE extern void stroke_init (void); #endif @@ -88,6 +87,10 @@ char *fontfile_paths[] = {"./default_font", PCBLIBDIR "/default_font", NULL}; +/* Try gui libs in this order when not explicitly specified by the user + if there are multiple GUIs available this sets the order of preference */ +static const char *try_gui_hids[] = {"gtk", "lesstif", NULL}; + /* ---------------------------------------------------------------------- * initialize signal and error handlers */ @@ -1672,9 +1675,21 @@ argc -= 2; argv += 2; } - else - gui = hid_find_gui (NULL); + else { + const char **g; + gui = NULL; + for(g = try_gui_hids; (*g != NULL) && (gui == NULL); g++) { + gui = hid_find_gui (*g); + } + + /* try anything */ + if (gui == NULL) { + Message("Warning: can't find any of the preferred GUIs, falling back to anything available...\n"); + gui = hid_find_gui (NULL); + } + } + /* Exit with error if GUI failed to start. */ if (!gui) exit (1);