mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-18 05:01:49 +03:00
Try to fix the crash again
This commit is contained in:
parent
c58b15c6da
commit
db4b4ec0d3
@ -49,9 +49,10 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
|
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
|
||||||
|
try {
|
||||||
if (pWindow->m_bIsX11) {
|
if (pWindow->m_bIsX11) {
|
||||||
if (pWindow->m_uSurface.xwayland) {
|
if (pWindow->m_uSurface.xwayland) {
|
||||||
return pWindow->m_uSurface.xwayland->title;
|
return std::string(pWindow->m_uSurface.xwayland->title);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
@ -59,11 +60,14 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
|
|||||||
|
|
||||||
if (pWindow->m_uSurface.xdg) {
|
if (pWindow->m_uSurface.xdg) {
|
||||||
if (pWindow->m_uSurface.xdg->toplevel) {
|
if (pWindow->m_uSurface.xdg->toplevel) {
|
||||||
return pWindow->m_uSurface.xdg->toplevel->title;
|
return std::string(pWindow->m_uSurface.xdg->toplevel->title);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
} catch (std::logic_error& e) {
|
||||||
|
Debug::log(ERR, "Error in getTitle: %s", e.what());
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user