From 2fd1476f8c99c4d4f6eb114cc7b5f8ac9ab54be4 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 28 Apr 2010 22:39:37 +0000 Subject: The schedule_run function is only called by the frontends so remove it from the core header and add its definition to the frontend headers. Alter the framebuffer schedule_run to return the time untill the next event. svn path=/trunk/netsurf/; revision=10512 --- framebuffer/gui.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'framebuffer/gui.c') diff --git a/framebuffer/gui.c b/framebuffer/gui.c index 7eae2b630..2689ffd8b 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -472,12 +472,18 @@ void gui_multitask(void) void gui_poll(bool active) { nsfb_event_t event; - int timeout = 0; + int timeout; - active |= schedule_run() | redraws_pending; + /* run the scheduler and discover how long to wait for the next event */ + timeout = schedule_run(); - if (!active) - timeout = -1; + /* if active do not wait for event, return immediately */ + if (active) + timeout = 0; + + /* if redraws are pending do not wait for event, return immediately */ + if (redraws_pending) + timeout = 0; if (fbtk_event(fbtk, &event, timeout)) { if ((event.type == NSFB_EVENT_CONTROL) && -- cgit v1.2.3