[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
This commit is contained in:
Martin Gräßlin 2016-07-13 10:08:25 +02:00
parent 56c2e158ee
commit f0aeda0738

View file

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