Skip to content
Commit f8d55a87 authored by Kristian Høgsberg's avatar Kristian Høgsberg
Browse files

client: Return number of events dispatched from dispatch functions

To let clients determine whether any events were dispatched, we return
the number of dispatched events.  An event source with an event queue
(such as wl_display or an X connection) may queue up event as a result of
processing a different event source (data on a network socket, timerfd etc).

After dispatching data from fd (or just before blocking) we have to check
such event sources, which is what wl_event_source_check() is used for.
A checked event source will have its handler called with mask=0 just
before blocking.  If any work is done in any of these handlers, we have
to check all the checked sources again, since the work could have queued up
events in a different source.  This is why the event handlers must return
a positive number if events were handled.  Which in turn is why we need
the wl_display dispatch functions to return that as well.
parent 78cfa967
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment