mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-25 17:21:54 -07:00
renderer: refuse rendering invalid resolutions
sometimes a driver fails to assign any reasonable mode in which case we might render 0x0 which will make us crash. Don't do that. Part 1 of #10678
This commit is contained in:
@@ -1165,6 +1165,11 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor) {
|
||||
|
||||
static int damageBlinkCleanup = 0; // because double-buffered
|
||||
|
||||
if (pMonitor->m_pixelSize.x < 1 || pMonitor->m_pixelSize.y < 1) {
|
||||
Debug::log(ERR, "Refusing to render a monitor because of an invalid pixel size: {}", pMonitor->m_pixelSize);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!*PDAMAGEBLINK)
|
||||
damageBlinkCleanup = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user