Fix a crash with setting title

This commit is contained in:
vaxerski
2022-03-22 17:31:19 +01:00
parent 8fe1cec87c
commit c58b15c6da
3 changed files with 28 additions and 11 deletions

View File

@@ -49,10 +49,23 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
}
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
if (pWindow->m_bIsX11)
return pWindow->m_uSurface.xwayland->title;
if (pWindow->m_bIsX11) {
if (pWindow->m_uSurface.xwayland) {
return pWindow->m_uSurface.xwayland->title;
}
} else {
return "";
}
if (pWindow->m_uSurface.xdg) {
if (pWindow->m_uSurface.xdg->toplevel) {
return pWindow->m_uSurface.xdg->toplevel->title;
}
} else {
return "";
}
return pWindow->m_uSurface.xdg->toplevel->title;
return "";
}
void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) {
@@ -114,4 +127,4 @@ void CHyprXWaylandManager::moveXWaylandWindow(CWindow* pWindow, const Vector2D&
if (pWindow->m_bIsX11) {
wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pos.x, pos.y, pWindow->m_vRealSize.x, pWindow->m_vRealSize.y);
}
}
}