mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-09 06:08:04 +02:00
Xlib/XCB: inline wait_or_poll_for_event, which now had only one caller.
Commit by Josh Triplett and Jamey Sharp.
This commit is contained in:
parent
c337f9de7c
commit
f417570735
1 changed files with 10 additions and 16 deletions
26
src/xcb_io.c
26
src/xcb_io.c
|
|
@ -102,21 +102,6 @@ static void call_handlers(Display *dpy, xcb_generic_reply_t *buf)
|
|||
_XError(dpy, (xError *) buf);
|
||||
}
|
||||
|
||||
static xcb_generic_event_t * wait_or_poll_for_event(Display *dpy, int wait)
|
||||
{
|
||||
xcb_connection_t *c = dpy->xcb->connection;
|
||||
xcb_generic_event_t *event;
|
||||
if(wait)
|
||||
{
|
||||
UnlockDisplay(dpy);
|
||||
event = xcb_wait_for_event(c);
|
||||
LockDisplay(dpy);
|
||||
}
|
||||
else
|
||||
event = xcb_poll_for_event(c);
|
||||
return event;
|
||||
}
|
||||
|
||||
static void process_responses(Display *dpy, int wait_for_first_event, xcb_generic_error_t **current_error, unsigned int current_request)
|
||||
{
|
||||
void *reply;
|
||||
|
|
@ -125,7 +110,16 @@ static void process_responses(Display *dpy, int wait_for_first_event, xcb_generi
|
|||
PendingRequest *req;
|
||||
xcb_connection_t *c = dpy->xcb->connection;
|
||||
if(!event && dpy->xcb->event_owner == XlibOwnsEventQueue)
|
||||
event = wait_or_poll_for_event(dpy, wait_for_first_event);
|
||||
{
|
||||
if(wait_for_first_event)
|
||||
{
|
||||
UnlockDisplay(dpy);
|
||||
event = xcb_wait_for_event(c);
|
||||
LockDisplay(dpy);
|
||||
}
|
||||
else
|
||||
event = xcb_poll_for_event(c);
|
||||
}
|
||||
|
||||
while(1)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue