From 862756a1a47553f317970f3a04fce3bd204792f6 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 15 Aug 2021 05:44:52 +0100 Subject: [PATCH] RISC OS: initialise font subsystem after Wimp_Initialise If RUfl detects it is running in a Wimp task it will display a progress meter while scanning fonts. We had this behaviour until ~2017, when it became broken due to the font initialisation being moved before the call to Wimp_Initialise (because the hotlist display logic got moved to the treeview, which needs fonts set up) Move both the font and hotlist initialisation after the call to Wimp_Initialise to restore the desired behaviour. --- frontends/riscos/gui.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c index f9268cac1..6b8f1a56b 100644 --- a/frontends/riscos/gui.c +++ b/frontends/riscos/gui.c @@ -1231,16 +1231,9 @@ static nserror gui_init(int argc, char** argv) /* Initialise save complete functionality */ save_complete_init(); - /* Initialise the font subsystem */ - nsfont_init(); - - /* Load in visited URLs, Cookies, and hostlist */ + /* Load in visited URLs and Cookies */ urldb_load(nsoption_charp(url_path)); urldb_load_cookies(nsoption_charp(cookie_file)); - hotlist_init(nsoption_charp(hotlist_path), - nsoption_bool(external_hotlists) ? - NULL : - nsoption_charp(hotlist_save)); /* Initialise with the wimp */ error = xwimp_initialise(wimp_VERSION_RO38, task_name, @@ -1271,6 +1264,15 @@ static nserror gui_init(int argc, char** argv) ro_message_register_route(message_WINDOW_INFO, ro_msg_window_info); + /* Initialise the font subsystem (must be after Wimp_Initialise) */ + nsfont_init(); + + /* Initialise the hotlist (must be after fonts) */ + hotlist_init(nsoption_charp(hotlist_path), + nsoption_bool(external_hotlists) ? + NULL : + nsoption_charp(hotlist_save)); + /* Initialise global information */ ro_gui_get_screen_properties(); ro_gui_wimp_get_desktop_font();