libinput: Make sure we don't crash if we start without an output

This commit is contained in:
Aleix Pol 2021-11-29 17:51:49 +01:00
parent 4dca6408c2
commit 5f16757090

View file

@ -477,7 +477,10 @@ void Connection::processEvents()
if (workspace()) { if (workspace()) {
#ifndef KWIN_BUILD_TESTING #ifndef KWIN_BUILD_TESTING
auto client = workspace()->activeClient(); auto client = workspace()->activeClient();
const auto *output = static_cast<AbstractWaylandOutput *>(client ? client->output() : tte->device()->output()); auto *output = static_cast<AbstractWaylandOutput *>(client ? client->output() : tte->device()->output());
if (!output) {
output = static_cast<AbstractWaylandOutput *>(workspace()->activeOutput());
}
const QPointF globalPos = const QPointF globalPos =
devicePointToGlobalPosition(tte->transformedPosition(output->modeSize()), devicePointToGlobalPosition(tte->transformedPosition(output->modeSize()),
output); output);