Skip to content
Commit 406afe4b authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer
Browse files

poll_for_response: Call poll_for_event again if xcb_poll_for_reply fails



If xcb_poll_for_reply fails to find a reply, poll_for_response would
always return NULL. However, xcb_poll_for_reply may have read events
from the display connection while looking for a reply. In that case,
returning NULL from poll_for_response is wrong and can result in the
client hanging, e.g. because it returns to waiting for the display
connection file descriptor becoming readable after XPending incorrectly
returned 0 pending events.

The solution is to call poll_for_event again after xcb_poll_for_reply
returned 0. This will return the first of any events read by
xcb_poll_for_reply.

Fixes issue #79.

Reported-by: default avatarYuxuan Shui <yshuiv7@gmail.com>
Bugzilla: https://bugs.freedesktop.org/108008
Bugzilla: https://bugs.freedesktop.org/107992


Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
parent d0416863
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment