mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 09:13:08 +03:00
Merge branch 'chris/scheduled-fetches' of git://git.netsurf-browser.org/netsurf into chris/scheduled-fetches
This commit is contained in:
commit
dcbbe9901e
@ -85,7 +85,6 @@ enum {
|
||||
};
|
||||
|
||||
int downloads_in_progress = 0;
|
||||
BYTE original_task_priority = 0;
|
||||
|
||||
struct gui_download_window *gui_download_window_create(download_context *ctx,
|
||||
struct gui_window *gui)
|
||||
@ -186,13 +185,6 @@ struct gui_download_window *gui_download_window_create(download_context *ctx,
|
||||
dw->node = AddObject(window_list,AMINS_DLWINDOW);
|
||||
dw->node->objstruct = dw;
|
||||
|
||||
/* Set task priority to -1.
|
||||
* NetSurf loops without Wait()ing when downloading,
|
||||
* so this gives other tasks a bit more CPU time. */
|
||||
if(downloads_in_progress == 0) {
|
||||
original_task_priority = SetTaskPri(FindTask(0), (BYTE)nsoption_int(download_task_pri));
|
||||
LOG(("Now running at priority %d (was %d)", nsoption_int(download_task_pri), original_task_priority));
|
||||
}
|
||||
downloads_in_progress++;
|
||||
|
||||
return dw;
|
||||
@ -282,12 +274,7 @@ void gui_download_window_done(struct gui_download_window *dw)
|
||||
SetComment(dw->fname, dw->url);
|
||||
if(dw->url) free(dw->url);
|
||||
|
||||
/* Set task priority back to what it was originally */
|
||||
downloads_in_progress--;
|
||||
if(downloads_in_progress == 0) {
|
||||
BYTE taskpri = SetTaskPri(FindTask(0), original_task_priority);
|
||||
LOG(("Now running at priority %d (was %d)", original_task_priority, taskpri));
|
||||
}
|
||||
|
||||
DisposeObject(dw->objects[OID_MAIN]);
|
||||
DelObject(dw->node);
|
||||
|
18
amiga/gui.c
18
amiga/gui.c
@ -2460,27 +2460,9 @@ printf("sig recvd %ld (%ld %ld %ld %ld %ld %ld)\n", signal, winsignal , appsig ,
|
||||
}
|
||||
|
||||
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(0)
|
||||
{
|
||||
ami_handle_msg();
|
||||
ami_handle_appmsg();
|
||||
ami_handle_applib();
|
||||
ami_arexx_handle();
|
||||
schedule_run(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ami_get_msg();
|
||||
}
|
||||
}
|
||||
|
||||
void ami_change_tab(struct gui_window_2 *gwin, int direction)
|
||||
{
|
||||
|
@ -48,7 +48,6 @@
|
||||
char *arexx_shutdown; \
|
||||
char *download_dir; \
|
||||
bool download_notify; \
|
||||
int download_task_pri; \
|
||||
bool faster_scroll; \
|
||||
bool scale_quality; \
|
||||
int dither_quality; \
|
||||
@ -115,7 +114,6 @@
|
||||
.arexx_shutdown = NULL, \
|
||||
.download_dir = NULL, \
|
||||
.download_notify = false, \
|
||||
.download_task_pri = -1, \
|
||||
.faster_scroll = true, \
|
||||
.scale_quality = false, \
|
||||
.dither_quality = 1, \
|
||||
@ -181,7 +179,6 @@
|
||||
{ "arexx_shutdown", OPTION_STRING, &nsoptions.arexx_shutdown }, \
|
||||
{ "download_dir", OPTION_STRING, &nsoptions.download_dir }, \
|
||||
{ "download_notify", OPTION_BOOL, &nsoptions.download_notify}, \
|
||||
{ "download_task_pri", OPTION_INTEGER, &nsoptions.download_task_pri}, \
|
||||
{ "faster_scroll", OPTION_BOOL, &nsoptions.faster_scroll}, \
|
||||
{ "scale_quality", OPTION_BOOL, &nsoptions.scale_quality}, \
|
||||
{ "dither_quality", OPTION_INTEGER, &nsoptions.dither_quality}, \
|
||||
|
@ -254,6 +254,7 @@ int netsurf_main_loop(void)
|
||||
if(fetch_active)
|
||||
schedule(0, netsurf_fetch_callback, NULL);
|
||||
gui_poll(fetch_active);
|
||||
hlcache_poll();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user