Always bail out when the compositor is closed
errno can both be EPIPE and ECONNRESET when reading from the connection after the server is closed. Change-Id: I03b64a382db3de66819277e9955aeca3e2d7f9a1 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
parent
0431544ee3
commit
5d9ed010d5
@ -149,7 +149,7 @@ QWaylandDisplay::~QWaylandDisplay(void)
|
|||||||
|
|
||||||
void QWaylandDisplay::flushRequests()
|
void QWaylandDisplay::flushRequests()
|
||||||
{
|
{
|
||||||
if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) == -1 && errno == EPIPE) {
|
if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) == -1 && (errno == EPIPE || errno == ECONNRESET)) {
|
||||||
qWarning("The Wayland connection broke. Did the Wayland compositor die?");
|
qWarning("The Wayland connection broke. Did the Wayland compositor die?");
|
||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ void QWaylandDisplay::flushRequests()
|
|||||||
|
|
||||||
void QWaylandDisplay::blockingReadEvents()
|
void QWaylandDisplay::blockingReadEvents()
|
||||||
{
|
{
|
||||||
if (wl_display_dispatch_queue(mDisplay, mEventQueue) == -1 && errno == EPIPE) {
|
if (wl_display_dispatch_queue(mDisplay, mEventQueue) == -1 && (errno == EPIPE || errno == ECONNRESET)) {
|
||||||
qWarning("The Wayland connection broke. Did the Wayland compositor die?");
|
qWarning("The Wayland connection broke. Did the Wayland compositor die?");
|
||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ void QWaylandEventThread::displayConnect()
|
|||||||
|
|
||||||
void QWaylandEventThread::readWaylandEvents()
|
void QWaylandEventThread::readWaylandEvents()
|
||||||
{
|
{
|
||||||
if (wl_display_dispatch(m_display) == -1 && errno == EPIPE) {
|
if (wl_display_dispatch(m_display) == -1 && (errno == EPIPE || errno == ECONNRESET)) {
|
||||||
qWarning("The Wayland connection broke. Did the Wayland compositor die?");
|
qWarning("The Wayland connection broke. Did the Wayland compositor die?");
|
||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user