headless: add a default mode for headless outputs (#87)

This commit is contained in:
Maximilian Seidler 2024-09-24 19:09:40 +00:00 committed by GitHub
parent 8b728612a9
commit 203fc0f4e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,6 +131,7 @@ std::vector<SDRMFormat> Aquamarine::CHeadlessBackend::getCursorFormats() {
bool Aquamarine::CHeadlessBackend::createOutput(const std::string& name) {
auto output = SP<CHeadlessOutput>(new CHeadlessOutput(name.empty() ? std::format("HEADLESS-{}", ++outputIDCounter) : name, self.lock()));
outputs.emplace_back(output);
output->modes.emplace_back(SP<SOutputMode>(new SOutputMode(Vector2D{1920, 1080}, 60, true)));
output->swapchain = CSwapchain::create(backend->primaryAllocator, self.lock());
output->self = output;
backend->events.newOutput.emit(SP<IOutput>(output));