diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-22 17:31:19 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-22 17:31:19 +0100 |
| commit | c58b15c6da180c2d141316ef0cf5bd35417da78e (patch) | |
| tree | 6a52f72ebb69e6ef21465bc8fe48e72e04740c30 /src/managers/XWaylandManager.cpp | |
| parent | 8fe1cec87ce4a0dc580a36be31fe198d375c21fa (diff) | |
Fix a crash with setting title
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
| -rw-r--r-- | src/managers/XWaylandManager.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index ac183023..05717a58 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -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); } -}
\ No newline at end of file +} |
