summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2013-04-16 00:28:20 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2013-04-16 00:28:20 +0100
commit729fa8f98e07dda6502545ca8f4f24e230d6f76d (patch)
treece5f1133175315ce4795c2ee9e64f084ef6c4dc7 /amiga/gui.c
parent3edaf9ed2ea8bca302cccc218e12bf0b925d2ff3 (diff)
parentd167da308bd8e4b32f4c43de79161efa8d3b1435 (diff)
downloadnetsurf-729fa8f98e07dda6502545ca8f4f24e230d6f76d.tar.gz
netsurf-729fa8f98e07dda6502545ca8f4f24e230d6f76d.tar.bz2
Merge branch 'chris/scheduled-fetches'
Fixes issue with NetSurf hogging CPU time on AmigaOS
Diffstat (limited to 'amiga/gui.c')
-rw-r--r--amiga/gui.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 998b169b0..fbe46d0b5 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -17,6 +17,7 @@
*/
/* NetSurf core includes */
+#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/utils.h"
#include "desktop/browser_private.h"
@@ -2459,27 +2460,19 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig ,
}
}
+static void ami_gui_fetch_callback(void *p)
+{
+ /* This doesn't need to do anything - the scheduled event will
+ * send a message to trigger Wait() to return, thereby causing
+ * the event function to return, and NetSurf to call
+ * hlcache_poll() as part of the usual fetch/event loop.
+ */
+}
+
void gui_poll(bool active)
{
- /* However, down here we are waiting for the user to do something or for a
- scheduled event to kick in (the active variable seems to have no real
- bearing on reality, but is supposed to indicate that NetSurf wants
- control back ASAP, so we poll in that case).
- schedule_run checks every event, really they need to be sorted so only
- the first event needs to be run on each signal. */
-
- if(active)
- {
- ami_handle_msg();
- ami_handle_appmsg();
- ami_handle_applib();
- ami_arexx_handle();
- schedule_run(TRUE);
- }
- else
- {
- ami_get_msg();
- }
+ if(active) schedule(0, ami_gui_fetch_callback, NULL);
+ ami_get_msg();
}
void ami_change_tab(struct gui_window_2 *gwin, int direction)