diff options
author | James Bursa <james@netsurf-browser.org> | 2004-03-30 11:45:48 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-03-30 11:45:48 +0000 |
commit | 804cd42a34d9c194a8a59df54b991f062781ad11 (patch) | |
tree | dfc3693bb931dade2e442c97dd166cf52deba022 /riscos | |
parent | ead74d2f010a232f15d074ef47a0622b5bd9bf66 (diff) | |
download | netsurf-804cd42a34d9c194a8a59df54b991f062781ad11.tar.gz netsurf-804cd42a34d9c194a8a59df54b991f062781ad11.tar.bz2 |
[project @ 2004-03-30 11:45:48 by bursa]
Reduce frequency of gui_multitask() to improve performance.
svn path=/import/netsurf/; revision=691
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/gui.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/riscos/gui.c b/riscos/gui.c index b58e5cc3c..4c7bfb8ac 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -60,6 +60,7 @@ bool gui_reformat_pending = false; /**< Some windows have been resized, and should be reformatted. */ gui_drag_type gui_current_drag_type; static wimp_t task_handle; /**< RISC OS wimp task handle. */ +static clock_t gui_last_poll; /**< Time of last wimp_poll. */ /** Accepted wimp user messages. */ static const wimp_MESSAGE_LIST(26) task_messages = { { message_DATA_SAVE, @@ -321,6 +322,7 @@ void gui_poll(bool active) event = wimp_poll(wimp_MASK_NULL | mask, &block, 0); } xhourglass_on(); + gui_last_poll = clock(); ro_gui_handle_event(event, &block); schedule_run(); @@ -412,9 +414,13 @@ void gui_multitask(void) wimp_event_no event; wimp_block block; + if (clock() < gui_last_poll + 10) + return; + xhourglass_off(); event = wimp_poll(wimp_MASK_LOSE | wimp_MASK_GAIN, &block, 0); xhourglass_on(); + gui_last_poll = clock(); switch (event) { case wimp_CLOSE_WINDOW_REQUEST: |