Skip to content
Commits on Source (4)
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libX11], [1.6.6],
AC_INIT([libX11], [1.6.7],
[https://gitlab.freedesktop.org/xorg/lib/libx11/issues], [libX11])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h])
......
......@@ -230,7 +230,7 @@ static void widen(uint64_t *wide, unsigned int narrow)
* variable for that thread to process the response and wake us up.
*/
static xcb_generic_reply_t *poll_for_event(Display *dpy)
static xcb_generic_reply_t *poll_for_event(Display *dpy, Bool queued_only)
{
/* Make sure the Display's sequence numbers are valid */
require_socket(dpy);
......@@ -238,8 +238,12 @@ static xcb_generic_reply_t *poll_for_event(Display *dpy)
/* Precondition: This thread can safely get events from XCB. */
assert(dpy->xcb->event_owner == XlibOwnsEventQueue && !dpy->xcb->event_waiter);
if(!dpy->xcb->next_event)
if(!dpy->xcb->next_event) {
if(queued_only)
dpy->xcb->next_event = xcb_poll_for_queued_event(dpy->xcb->connection);
else
dpy->xcb->next_event = xcb_poll_for_event(dpy->xcb->connection);
}
if(dpy->xcb->next_event)
{
......@@ -271,12 +275,21 @@ static xcb_generic_reply_t *poll_for_response(Display *dpy)
void *response;
xcb_generic_error_t *error;
PendingRequest *req;
while(!(response = poll_for_event(dpy)) &&
while(!(response = poll_for_event(dpy, False)) &&
(req = dpy->xcb->pending_requests) &&
!req->reply_waiter &&
xcb_poll_for_reply64(dpy->xcb->connection, req->sequence, &response, &error))
!req->reply_waiter)
{
uint64_t request = X_DPY_GET_REQUEST(dpy);
uint64_t request;
if(!xcb_poll_for_reply64(dpy->xcb->connection, req->sequence,
&response, &error)) {
/* xcb_poll_for_reply64 may have read events even if
* there is no reply. */
response = poll_for_event(dpy, True);
break;
}
request = X_DPY_GET_REQUEST(dpy);
if(XLIB_SEQUENCE_COMPARE(req->sequence, >, request))
{
throw_thread_fail_assert("Unknown sequence number "
......@@ -617,7 +630,7 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
{ /* need braces around ConditionWait */
ConditionWait(dpy, dpy->xcb->event_notify);
}
while((event = poll_for_event(dpy)))
while((event = poll_for_event(dpy, True)))
handle_response(dpy, event, True);
}
......
......@@ -76,7 +76,8 @@ XcmsLookupColor (
register int n;
xLookupColorReply reply;
register xLookupColorReq *req;
XColor def, scr;
XColor def = {0,};
XColor scr = {0,};
/*
* 0. Check for invalid arguments.
......