From d4c3ca3b449a23433144c2f73cda2a650e0e8d7c Mon Sep 17 00:00:00 2001 From: Phantasm Date: Sun, 6 Aug 2023 20:38:16 +0200 Subject: [PATCH] Handle bad screen-root arguments in X11 mode Still leaves a SIGABRT after the thrown exception from the logging system. --- src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp b/src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp index bbc8c71..ef529be 100644 --- a/src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp +++ b/src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp @@ -167,6 +167,11 @@ void CX11Output::loadScreenInfo () XRRFreeScreenResources (screenResources); + // Check if all screens from --screen-root are actually screens + if (this->m_viewports.size() != this->m_context.settings.general.screenBackgrounds.size()) { + sLog.exception("Invalid screen in arguments."); + } + // create pixmap so we can draw things in there this->m_pixmap = XCreatePixmap (this->m_display, this->m_root, this->m_fullWidth, this->m_fullHeight, 24); this->m_gc = XCreateGC (this->m_display, this->m_pixmap, 0, nullptr);