We're currently calling ppoll() before calling xcb_wait_for_event(), which
may be due to initially trying to make this non-blocking.
However, xcb_wait_for_event() reads all events available - even if there
are more than one.
There are a handful of X properties we're sent that we don't explicitly
ask for, and if these end up in the same read, we could theoretically
end up in a poll() with nothing coming in.
Drop the extra ppoll() and just let xcb_wait_for_event() do the blocking
for us.
I'm hoping this fixes the occasional timeout in the xwayland test, but
it's a reasonable code simplification even if it doesn't.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We're still timing out with our basic xwayland test in CI, so this
enables the XWM logging scope, and enables some further print debugs we
have available in our helper library, in an attempt to further
investigate and determine why we're still timing out.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This patch introduces a small library wrapper around XCB to be used in
Xwayland tests.
It's being designed such that we do not advance without accounting for
all X11 events when changing the window state. It adds a fence that
waits for all events to be processed, and only after all the events have
been accounted for, to proceed further, resuming execution of the
tests.
This works by keeping a tentative_state list for the client and a
window state that gets applied when the event we waited for has been
received.
This is useful in test clients, which could verify at the end after
receiving all events that the correct state has been applied. Acts as a
way to verify that the we never get or have a different state than the
one we expect.
With it, this converts test-xwayland to using libxcb (together with
xcb-cursor-dev) rather than using Xlib, and with it it removes any Xlib
dependency we might have in the tests.
This only adds support for map/unmap/create/destroy/property notify.
A follow-up would be to expand this library to track window movement
and resizing.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>