XCB: Handle connection errors
authorUli Schlachter <psychon@znc.in>
Thu, 1 Nov 2012 17:40:37 +0000 (18:40 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 2 Nov 2012 17:07:35 +0000 (18:07 +0100)
commit0b1ce5db9e04b4c28713e87306fcea020c3e428b
treebefc8c1e1417bd1f744a47583e2836afa18beb21
parent92d75077d686fcad26b5ad02a40c3987fb1fc82b
XCB: Handle connection errors

When the XCB connection breaks, all following XCB function calls will fail and
function calls that are currently in progress will return. This means that
xcb_wait_for_event() will return NULL and thus the QXcbEventReader thread will
exit.

This patch uses the above behavior to make sure that processXcbEvents() will be
called. The error handling should always be done before normal event processing,
because all XCB calls will fail once the connection is in an error state. This
is especially unexpected for xcb_get_setup() which suddenly returns a NULL
pointer.

Task-number: QTBUG-27686

Change-Id: Ie3e4058f9d92bcbfc45934a8b36d9a7254e2b4bb
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
src/plugins/platforms/xcb/qxcbconnection.cpp