mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 13:49:49 +01:00
Fix crash when screen size is 0x0 (#2523)
(When booting into laptop clam mode in dell XPS) and also ignore any screen with size 0x0 in the first place Co-authored-by: giladsx <gilad@spectalix.com>
This commit is contained in:
parent
d768226de9
commit
302ec1372c
2 changed files with 8 additions and 3 deletions
|
@ -57,6 +57,11 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OUTPUT->width <= 0 || OUTPUT->height <= 0) {
|
||||||
|
Debug::log(ERR, "New monitor has no dimensions?? Ignoring");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_pCompositor->m_bUnsafeState) {
|
if (g_pCompositor->m_bUnsafeState) {
|
||||||
Debug::log(WARN, "Recovering from an unsafe state. May you be lucky.");
|
Debug::log(WARN, "Recovering from an unsafe state. May you be lucky.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1165,7 +1165,7 @@ void CHyprOpenGLImpl::makeRawWindowSnapshot(CWindow* pWindow, CFramebuffer* pFra
|
||||||
// we trust the window is valid.
|
// we trust the window is valid.
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
||||||
|
|
||||||
if (!PMONITOR || !PMONITOR->output)
|
if (!PMONITOR || !PMONITOR->output || PMONITOR->vecPixelSize.x <= 0 || PMONITOR->vecPixelSize.y <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wlr_output_attach_render(PMONITOR->output, nullptr);
|
wlr_output_attach_render(PMONITOR->output, nullptr);
|
||||||
|
@ -1224,7 +1224,7 @@ void CHyprOpenGLImpl::makeWindowSnapshot(CWindow* pWindow) {
|
||||||
// we trust the window is valid.
|
// we trust the window is valid.
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
||||||
|
|
||||||
if (!PMONITOR || !PMONITOR->output)
|
if (!PMONITOR || !PMONITOR->output || PMONITOR->vecPixelSize.x <= 0 || PMONITOR->vecPixelSize.y <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wlr_output_attach_render(PMONITOR->output, nullptr);
|
wlr_output_attach_render(PMONITOR->output, nullptr);
|
||||||
|
@ -1288,7 +1288,7 @@ void CHyprOpenGLImpl::makeLayerSnapshot(SLayerSurface* pLayer) {
|
||||||
// we trust the window is valid.
|
// we trust the window is valid.
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pLayer->monitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(pLayer->monitorID);
|
||||||
|
|
||||||
if (!PMONITOR || !PMONITOR->output)
|
if (!PMONITOR || !PMONITOR->output || PMONITOR->vecPixelSize.x <= 0 || PMONITOR->vecPixelSize.y <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wlr_output_attach_render(PMONITOR->output, nullptr);
|
wlr_output_attach_render(PMONITOR->output, nullptr);
|
||||||
|
|
Loading…
Reference in a new issue