mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
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.
This commit is contained in:
parent
af72b8163b
commit
1457d0b4c1
@ -155,6 +155,9 @@ namespace WallpaperEngine::Render::Drivers::Detectors
|
|||||||
|
|
||||||
XRRCrtcInfo* crtc = XRRGetCrtcInfo (this->m_display, screenResources, info->crtc);
|
XRRCrtcInfo* crtc = XRRGetCrtcInfo (this->m_display, screenResources, info->crtc);
|
||||||
|
|
||||||
|
if (crtc == nullptr)
|
||||||
|
continue;
|
||||||
|
|
||||||
// add the screen to the list of screens
|
// add the screen to the list of screens
|
||||||
this->m_screens.push_back (
|
this->m_screens.push_back (
|
||||||
{
|
{
|
||||||
@ -178,4 +181,4 @@ namespace WallpaperEngine::Render::Drivers::Detectors
|
|||||||
this->m_display = nullptr;
|
this->m_display = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -136,6 +136,9 @@ void CX11Output::loadScreenInfo ()
|
|||||||
|
|
||||||
XRRCrtcInfo* crtc = XRRGetCrtcInfo (this->m_display, screenResources, info->crtc);
|
XRRCrtcInfo* crtc = XRRGetCrtcInfo (this->m_display, screenResources, info->crtc);
|
||||||
|
|
||||||
|
if (crtc == nullptr)
|
||||||
|
continue;
|
||||||
|
|
||||||
// add the screen to the list of screens
|
// add the screen to the list of screens
|
||||||
this->m_screens.push_back (
|
this->m_screens.push_back (
|
||||||
new CX11OutputViewport
|
new CX11OutputViewport
|
||||||
|
Loading…
Reference in New Issue
Block a user