From 21f8f8170a7ad9748a21703f8397349d68f3e660 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 12 Oct 2014 21:18:17 +0100 Subject: remove use of deprecated netsurf_quit variable in monkey The core no longer needs to run the event polling loop as fetches are now scheduler driven. This is part of a series which will ultimately remove netsurf_poll callback altogether. --- monkey/main.c | 11 ++++++++--- monkey/poll.c | 3 +-- monkey/poll.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/monkey/main.c b/monkey/main.c index 6a7c1d663..803372c66 100644 --- a/monkey/main.c +++ b/monkey/main.c @@ -39,6 +39,8 @@ char **respaths; /** resource search path vector */ +static bool monkey_done = false; + /* Stolen from gtk/gui.c */ static char ** nsmonkey_init_resource(const char *resource_path) @@ -75,7 +77,7 @@ static nserror gui_launch_url(struct nsurl *url) static void quit_handler(int argc, char **argv) { - netsurf_quit = true; + monkey_done = true; } /** @@ -106,7 +108,6 @@ static bool nslog_stream_configure(FILE *fptr) } static struct gui_browser_table monkey_browser_table = { - .poll = monkey_poll, .schedule = monkey_schedule, .quit = monkey_quit, @@ -176,7 +177,11 @@ main(int argc, char **argv) monkey_register_handler("WINDOW", monkey_window_handle_command); fprintf(stdout, "GENERIC STARTED\n"); - netsurf_main_loop(); + + while (!monkey_done) { + monkey_poll(); + } + fprintf(stdout, "GENERIC CLOSING_DOWN\n"); monkey_kill_browser_windows(); diff --git a/monkey/poll.c b/monkey/poll.c index e65f2d3e2..3fad21f0f 100644 --- a/monkey/poll.c +++ b/monkey/poll.c @@ -87,8 +87,7 @@ monkey_prepare_input(void) g_source_attach((GSource *)gs, NULL); } -void -monkey_poll(bool active) +void monkey_poll(void) { fd_set read_fd_set, write_fd_set, exc_fd_set; int max_fd; diff --git a/monkey/poll.h b/monkey/poll.h index 4195958c9..2b14e61bd 100644 --- a/monkey/poll.h +++ b/monkey/poll.h @@ -21,6 +21,6 @@ void monkey_prepare_input(void); -void monkey_poll(bool active); +void monkey_poll(void); #endif /* NETSURF_MONKEY_POLL_H */ -- cgit v1.2.3