diff --git a/src/plugins/platforms/fbdev/fb_backend.cpp b/src/plugins/platforms/fbdev/fb_backend.cpp index a687348787..cddaa34748 100644 --- a/src/plugins/platforms/fbdev/fb_backend.cpp +++ b/src/plugins/platforms/fbdev/fb_backend.cpp @@ -103,11 +103,14 @@ bool FramebufferBackend::initialize() { setSoftwareCursorForced(true); - QString framebufferDevice = deviceIdentifier().constData(); + QByteArray framebufferDevice = deviceIdentifier(); if (framebufferDevice.isEmpty()) { - framebufferDevice = QString(Udev().listFramebuffers().at(0)->devNode()); + const auto fbs = Udev().listFramebuffers(); + if (fbs.size() > 0) { + framebufferDevice = fbs.at(0)->devNode(); + } } - int fd = open(framebufferDevice.toUtf8().constData(), O_RDWR | O_CLOEXEC); + int fd = open(framebufferDevice.constData(), O_RDWR | O_CLOEXEC); qCDebug(KWIN_FB) << "Using frame buffer device:" << framebufferDevice; if (fd < 0) { qCWarning(KWIN_FB) << "failed to open frame buffer device:" << framebufferDevice;