From ee8fb6f39f3014cf4e4c17a28904850a58f2f4f3 Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sun, 8 Sep 2013 13:27:11 +0100 Subject: Allow ro_mouse to enable null polls; remove unused global variables. Implement ro_mouse_poll_interval() to allow ro_mouse to influence null polling. Remove unused calls to drag type globals. --- riscos/gui.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'riscos/gui.c') diff --git a/riscos/gui.c b/riscos/gui.c index 890c5ddc2..3ce44fd05 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -161,11 +161,6 @@ const char * NETSURF_DIR; static const char *task_name = "NetSurf"; #define CHOICES_PREFIX ".WWW.NetSurf." -/** The pointer is over a window which is tracking mouse movement. */ -static bool gui_track = false; -/** Browser window which the pointer is over, or 0 if none. */ -struct gui_window *gui_track_gui_window; - ro_gui_drag_type gui_current_drag_type; wimp_t task_handle; /**< RISC OS wimp task handle. */ static clock_t gui_last_poll; /**< Time of last wimp_poll. */ @@ -1026,26 +1021,19 @@ void gui_poll(bool active) wimp_block block; const wimp_poll_flags mask = wimp_MASK_LOSE | wimp_MASK_GAIN | wimp_SAVE_FP; + os_t track_poll_offset; /* Poll wimp. */ xhourglass_off(); + track_poll_offset = ro_mouse_poll_interval(); if (active) { event = wimp_poll(mask, &block, 0); - } else if (sched_active || gui_track || TRUE || browser_reformat_pending || + } else if (sched_active || (track_poll_offset > 0) || browser_reformat_pending || bitmap_maintenance) { os_t t = os_read_monotonic_time(); - if (gui_track) - switch (gui_current_drag_type) { - case GUI_DRAG_SELECTION: - case GUI_DRAG_SCROLL: - t += 4; /* for smoother update */ - break; - - default: - t += 10; - break; - } + if (track_poll_offset > 0) + t += track_poll_offset; else t += 10; -- cgit v1.2.3