xwl: don't try to get unmanaged titles

This commit is contained in:
vaxerski 2023-03-03 19:37:20 +00:00
parent 141365cbc1
commit fe007fd36a

View file

@ -90,6 +90,9 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
} }
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) { std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
if (!pWindow->m_bIsMapped)
return "";
try { try {
if (pWindow->m_bIsX11) { if (pWindow->m_bIsX11) {
if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->title) { if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->title) {
@ -108,12 +111,12 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
} }
std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) { std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
if (!pWindow->m_bMappedX11 || !pWindow->m_bIsMapped)
return "";
try { try {
if (pWindow->m_bIsX11) { if (pWindow->m_bIsX11) {
if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->_class) { if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->_class) {
if (!pWindow->m_bMappedX11 || !pWindow->m_bIsMapped)
return "unmanaged X11";
return std::string(pWindow->m_uSurface.xwayland->_class); return std::string(pWindow->m_uSurface.xwayland->_class);
} }
} else if (pWindow->m_uSurface.xdg) { } else if (pWindow->m_uSurface.xdg) {