Closed Bug 462833 Opened 12 years ago Closed 11 years ago

Need cross-platform API for checking for pending user events


(Core :: Widget, defect)

Not set





(Reporter: sicking, Unassigned)



It would be really rocking to have an API that could be used to check if there are pending input events (such as from mouse or keyboard). We could then use this API at various points during parsing and other potentially long running, but interruptable tasks (bug 67752 has a patch to add reflow to this list) to detect when we need to return out to the main event loop.

It would help a lot to have this API rather than simply every so often posting an event and returning out to the event loop based on time (this is what the parser currently does). Aborting the current algorithm and returning to the event loop can be very costly, so we want to do this as rarely as possible, however we do want to do it as quickly as possible once there is an event to process.

Another thing that would be great is if this API is fairly efficient. Currently in parsing we use a back-off counter to prevent calling PR_Now too often. This means that if we happen to hit a number of consecutive tokens that are slow to parse, we might spend a long time parsing before even checking if we need to return to the event loop.

In other words, the faster an API for checking for pending events is, the more often we'll call it, and the quicker we'll start unwinding back to the event loop. Ideal would be if it just amounted to checking a static global which is set from a separate thread.
We probably want to avoid interrupting for mouse moves with no button down.
This was fixed by the patch for bug 67752.
No longer blocks: ireflow
Closed: 11 years ago
Depends on: ireflow
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.