diff --git a/riscos/download.c b/riscos/download.c index a03ff474b..f52bbe88d 100644 --- a/riscos/download.c +++ b/riscos/download.c @@ -1599,7 +1599,7 @@ void ro_gui_download_close_confirmed(query_id id, enum query_response res, void /* and restart the shutdown */ if (ro_gui_prequit()) - netsurf_quit = true; + riscos_done = true; } else ro_gui_download_window_destroy(dw, false); diff --git a/riscos/gui.c b/riscos/gui.c index 2e337e5a2..944696fda 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -85,6 +85,8 @@ #include "riscos/content-handlers/draw.h" #include "riscos/content-handlers/sprite.h" +bool riscos_done = false; + extern bool ro_plot_patterned_lines; int os_version = 0; @@ -1777,7 +1779,7 @@ static void ro_gui_user_message(wimp_event_no event, wimp_message *message) ro_gui_hotlist_add_cleanup(); break; case message_QUIT: - netsurf_quit = true; + riscos_done = true; break; } } @@ -1854,7 +1856,7 @@ static void ro_gui_handle_event(wimp_event_no event, wimp_block *block) /** * Poll the RISC OS wimp for events. */ -static void riscos_poll(bool active) +static void riscos_poll(void) { wimp_event_no event; wimp_block block; @@ -2401,7 +2403,6 @@ static struct gui_fetch_table riscos_fetch_table = { }; static struct gui_browser_table riscos_browser_table = { - .poll = riscos_poll, .schedule = riscos_schedule, .quit = gui_quit, @@ -2524,7 +2525,9 @@ int main(int argc, char** argv) warn_user(messages_get_errorcode(ret), 0); } - netsurf_main_loop(); + while (!riscos_done) { + riscos_poll(); + } netsurf_exit(); diff --git a/riscos/gui.h b/riscos/gui.h index 3403f551e..65f800267 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -72,6 +72,8 @@ typedef enum { GUI_DRAG_NONE, GUI_DRAG_DOWNLOAD_SAVE, GUI_DRAG_SAVE } extern ro_gui_drag_type gui_current_drag_type; +extern bool riscos_done; + /** RISC OS data for a browser window. */ struct gui_window { /** Associated platform-independent browser window data. */ diff --git a/riscos/iconbar.c b/riscos/iconbar.c index f29b019a2..6f0c7e083 100644 --- a/riscos/iconbar.c +++ b/riscos/iconbar.c @@ -239,7 +239,7 @@ bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, case APPLICATION_QUIT: if (ro_gui_prequit()) { LOG(("QUIT in response to user request")); - netsurf_quit = true; + riscos_done = true; } return true; default: