mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 03:22:31 +01:00
fix crash
This commit is contained in:
parent
ad4fc28f78
commit
ae3d1ec3ad
1 changed files with 7 additions and 4 deletions
|
@ -51,18 +51,21 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
|
||||||
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
|
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
|
||||||
try {
|
try {
|
||||||
if (pWindow->m_bIsX11) {
|
if (pWindow->m_bIsX11) {
|
||||||
if (pWindow->m_uSurface.xwayland) {
|
if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->title) {
|
||||||
return std::string(pWindow->m_uSurface.xwayland->title);
|
return std::string(pWindow->m_uSurface.xwayland->title);
|
||||||
}
|
}
|
||||||
} else if (pWindow->m_uSurface.xdg) {
|
} else if (pWindow->m_uSurface.xdg) {
|
||||||
if (pWindow->m_uSurface.xdg->toplevel) {
|
if (pWindow->m_uSurface.xdg->toplevel && pWindow->m_uSurface.xdg->toplevel->title) {
|
||||||
return std::string(pWindow->m_uSurface.xdg->toplevel->title);
|
return std::string(pWindow->m_uSurface.xdg->toplevel->title);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
} catch (std::logic_error& e) {
|
} catch (std::exception& e) {
|
||||||
Debug::log(ERR, "Error in getTitle: %s", e.what());
|
if (e.what())
|
||||||
|
Debug::log(ERR, "Error in getTitle: %s", e.what());
|
||||||
|
else
|
||||||
|
Debug::log(ERR, "Error in getTitle [e.what() nullptr]");
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue