[wayland] Determine whether libinput is needed from plugin metadata

If the backend specifies
{
"input": false
}

in it's plugin metadata, it means that it does not handle input by
itself. In that case we can enforce libinput.

With this change one does no longer need to specify --libinput when
starting kwin_wayland on the drm or fbdev backend. So

kwin_wayland --xwayland

will bring up a fully functional kwin_wayland on drm platform.
master
Martin Gräßlin 9 years ago
parent a3db04f66e
commit 8797f826f9

@ -614,6 +614,19 @@ int main(int argc, char * argv[])
}
for (const auto &candidate: pluginCandidates) {
if (qobject_cast<KWin::AbstractBackend*>(candidate.instantiate())) {
#if HAVE_INPUT
// check whether it needs libinput
const QJsonObject &metaData = candidate.rawData();
auto it = metaData.find(QStringLiteral("input"));
if (it != metaData.constEnd()) {
if ((*it).isBool()) {
if (!(*it).toBool()) {
std::cerr << "Backend does not support input, enforcing libinput support" << std::endl;
KWin::Application::setUseLibinput(true);
}
}
}
#endif
break;
}
}

Loading…
Cancel
Save