summaryrefslogtreecommitdiff
path: root/src/managers/XWaylandManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-22 17:41:23 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-22 17:41:23 +0100
commitdb4b4ec0d3a09b9194b102509b432b5d92b798c6 (patch)
treec48ce531efd0e664022cca3ac25b4cc6c2a76230 /src/managers/XWaylandManager.cpp
parentc58b15c6da180c2d141316ef0cf5bd35417da78e (diff)
Try to fix the crash again
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
-rw-r--r--src/managers/XWaylandManager.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 05717a58..4f8a15b7 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -49,20 +49,24 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
}
std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
- if (pWindow->m_bIsX11) {
- if (pWindow->m_uSurface.xwayland) {
- return pWindow->m_uSurface.xwayland->title;
+ try {
+ if (pWindow->m_bIsX11) {
+ if (pWindow->m_uSurface.xwayland) {
+ return std::string(pWindow->m_uSurface.xwayland->title);
+ }
+ } else {
+ return "";
}
- } else {
- return "";
- }
-
- if (pWindow->m_uSurface.xdg) {
- if (pWindow->m_uSurface.xdg->toplevel) {
- return pWindow->m_uSurface.xdg->toplevel->title;
+
+ if (pWindow->m_uSurface.xdg) {
+ if (pWindow->m_uSurface.xdg->toplevel) {
+ return std::string(pWindow->m_uSurface.xdg->toplevel->title);
+ }
+ } else {
+ return "";
}
- } else {
- return "";
+ } catch (std::logic_error& e) {
+ Debug::log(ERR, "Error in getTitle: %s", e.what());
}
return "";