handle invalid map

This commit is contained in:
vaxerski 2022-03-30 17:43:31 +02:00
parent 7439246efb
commit cd8d628c72
1 changed files with 5 additions and 0 deletions

View File

@ -341,6 +341,11 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) {
g_pXWaylandManager->getGeometryForWindow(pWindow, &desiredGeometry);
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
if (!PMONITOR){
Debug::log(ERR, "Window %x (%s) has an invalid monitor in onWindowCreatedFloating!!!", pWindow, pWindow->m_szTitle.c_str());
return;
}
if (desiredGeometry.width <= 0 || desiredGeometry.height <= 0) {
const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(pWindow);
pWindow->m_vEffectiveSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height);