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()) {
#ifndef KWIN_BUILD_TESTING
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 =
devicePointToGlobalPosition(tte->transformedPosition(output->modeSize()),
output);