summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2014-08-19 18:40:19 +0200
committerRobin Burchell <robin.burchell@viroteck.net>2014-08-19 18:46:11 +0200
commit564dd7ca4f1590da5559422e4ea98a2cef1992e6 (patch)
tree3ee3c68f4e4a2c5b866a65c21c8651c967d2ab98 /src/client/qwaylanddisplay.cpp
parentcee3e127f4c9d57a00c55d57957a99c7061aa863 (diff)
QWaylandDisplay: Centralize error handling in one place.
Change-Id: Ifba23e349a4006cea501480a7230408f0fafd1b7 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r--src/client/qwaylanddisplay.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 74efbfda4..94bfa88bc 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -166,16 +166,8 @@ QWaylandDisplay::~QWaylandDisplay(void)
void QWaylandDisplay::flushRequests()
{
- if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) < 0) {
- int ecode = wl_display_get_error(mDisplay);
- if ((ecode == EPIPE || ecode == ECONNRESET)) {
- // special case this to provide a nicer error
- qWarning("The Wayland connection broke. Did the Wayland compositor die?");
- } else {
- qErrnoWarning(ecode, "The Wayland connection experienced a fatal error");
- }
- ::exit(1);
- }
+ if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) < 0)
+ mEventThreadObject->checkErrorAndExit();
wl_display_flush(mDisplay);
}
@@ -183,16 +175,8 @@ void QWaylandDisplay::flushRequests()
void QWaylandDisplay::blockingReadEvents()
{
- if (wl_display_dispatch_queue(mDisplay, mEventQueue) < 0) {
- int ecode = wl_display_get_error(mDisplay);
- if ((ecode == EPIPE || ecode == ECONNRESET)) {
- // special case this to provide a nicer error
- qWarning("The Wayland connection broke. Did the Wayland compositor die?");
- } else {
- qErrnoWarning(ecode, "The Wayland connection experienced a fatal error");
- }
- ::exit(1);
- }
+ if (wl_display_dispatch_queue(mDisplay, mEventQueue) < 0)
+ mEventThreadObject->checkErrorAndExit();
}
QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const