فهرست منبع

Fix crash when 2+ screens are connected but not all are active in X11

When not all connected screens are active XRRGetCrtcInfo returns NULL
for the inactive screens resulting in a SIGSEGV when trying to push it
to the screens vector.
Phantasm 3 سال پیش
والد
کامیت
ee499b06e2

+ 4 - 1
src/WallpaperEngine/Render/Drivers/Detectors/CX11FullScreenDetector.cpp

@@ -155,6 +155,9 @@ namespace WallpaperEngine::Render::Drivers::Detectors
 
             XRRCrtcInfo* crtc = XRRGetCrtcInfo (this->m_display, screenResources, info->crtc);
 
+	    if (crtc == nullptr)
+		    continue;
+
             // add the screen to the list of screens
             this->m_screens.push_back (
                 {
@@ -178,4 +181,4 @@ namespace WallpaperEngine::Render::Drivers::Detectors
         this->m_display = nullptr;
     }
 
-}
+}

+ 3 - 0
src/WallpaperEngine/Render/Drivers/Output/CX11Output.cpp

@@ -136,6 +136,9 @@ void CX11Output::loadScreenInfo ()
 
         XRRCrtcInfo* crtc = XRRGetCrtcInfo (this->m_display, screenResources, info->crtc);
 
+	if (crtc == nullptr)
+		continue;
+
         // add the screen to the list of screens
         this->m_screens.push_back (
             new CX11OutputViewport