wayland: avoid leaving the swapchain null on late displays

This commit is contained in:
Vaxry 2024-07-01 14:59:16 +02:00
parent 13f94112aa
commit d1e48322ed

View file

@ -137,6 +137,8 @@ int Aquamarine::CWaylandBackend::drmFD() {
bool Aquamarine::CWaylandBackend::createOutput(const std::string& szName) {
auto o = outputs.emplace_back(SP<CWaylandOutput>(new CWaylandOutput(szName.empty() ? std::format("WAYLAND-{}", ++lastOutputID) : szName, self)));
o->self = o;
if (backend->ready)
o->swapchain = CSwapchain::create(backend->allocator, self.lock());
idleCallbacks.emplace_back([this, o]() { backend->events.newOutput.emit(SP<IOutput>(o)); });
return true;
}