[platforms/fbdev] Handle error conditions more gracefully

Summary:
So far if the framebuffer platform run into an error on initialization
it did not continue and caused the system to freeze. With this change
it properly emits the initFailed signal in all error conditions which
causes kwin_wayland to terminate. This is a much better situation than
just staying in a running, but frozen state.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2149
icc-effect-5.14.5
Martin Gräßlin 2016-07-13 10:08:25 +02:00
parent 56c2e158ee
commit f0aeda0738
1 changed files with 10 additions and 1 deletions

View File

@ -88,11 +88,20 @@ void FramebufferBackend::openFrameBuffer()
fd = open(deviceIdentifier().constData(), O_RDWR | O_CLOEXEC);
if (fd < 0) {
qCWarning(KWIN_FB) << "failed to open frame buffer device";
emit initFailed();
return;
}
m_fd = fd;
queryScreenInfo();
if (!queryScreenInfo()) {
qCWarning(KWIN_FB) << "failed to query framebuffer information";
emit initFailed();
return;
}
initImageFormat();
if (m_imageFormat == QImage::Format_Invalid) {
emit initFailed();
return;
}
setReady(true);
emit screensQueried();
}