waylandserver: fix logout crash

When we shut down we can have zero outputs, and thus a nullptr
primary output.
This commit is contained in:
Xaver Hugl 2021-11-09 22:05:50 +01:00
parent 1d96b41bb4
commit 29e5864402

View file

@ -276,7 +276,7 @@ void WaylandServer::initPlatform()
connect(kwinApp()->platform(), &Platform::outputDisabled, this, &WaylandServer::handleOutputDisabled);
connect(kwinApp()->platform(), &Platform::primaryOutputChanged, this, [this] (AbstractOutput *primaryOutput) {
m_primary->setPrimaryOutput(primaryOutput->name());
m_primary->setPrimaryOutput(primaryOutput ? primaryOutput->name() : "");
});
if (auto primaryOutput = kwinApp()->platform()->primaryOutput()) {
m_primary->setPrimaryOutput(primaryOutput->name());