compositor: fix crash when moving a workspace to a monitor with size 0x0 (#9848)

This commit is contained in:
Maximilian Seidler 2025-04-06 00:54:29 +02:00 committed by GitHub
parent ed05f14300
commit 433b7881a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2186,9 +2186,11 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo
*w->m_vRealPosition = pMonitor->vecPosition;
*w->m_vRealSize = pMonitor->vecSize;
}
} else {
*w->m_vRealPosition = Vector2D{(int)w->m_vRealPosition->goal().x % (int)pMonitor->vecSize.x, (int)w->m_vRealPosition->goal().y % (int)pMonitor->vecSize.y};
}
} else
*w->m_vRealPosition = Vector2D{
(pMonitor->vecSize.x != 0) ? (int)w->m_vRealPosition->goal().x % (int)pMonitor->vecSize.x : 0,
(pMonitor->vecSize.y != 0) ? (int)w->m_vRealPosition->goal().y % (int)pMonitor->vecSize.y : 0,
};
}
w->updateToplevel();