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
1 changed files with 2 additions and 0 deletions

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;
}