diff options
| author | jmanc3 <jman12316@live.com> | 2025-08-22 02:25:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-22 08:25:27 +0100 |
| commit | 42caff5587b6c43703b3c3d51878f156448994f6 (patch) | |
| tree | 7029050777271f6a0456fa20356a129ef1650729 /src/desktop/Window.cpp | |
| parent | 50a242f16abfc49efc6f89ea9cd14a3544888a25 (diff) | |
window: fix requestedMinSize crash (#11498)
There are cases where m_isX11 is true but m_xwaylandSurface doesn't exist.
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index e9c386ce..861fc2b2 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1692,7 +1692,9 @@ bool CWindow::isModal() { } Vector2D CWindow::requestedMinSize() { - if ((m_isX11 && !m_xwaylandSurface->m_sizeHints) || (!m_isX11 && !m_xdgSurface->m_toplevel)) + bool hasSizeHints = m_xwaylandSurface ? m_xwaylandSurface->m_sizeHints : false; + bool hasTopLevel = m_xdgSurface ? m_xdgSurface->m_toplevel : false; + if ((m_isX11 && !hasSizeHints) || (!m_isX11 && !hasTopLevel)) return Vector2D(1, 1); Vector2D minSize = m_isX11 ? Vector2D(m_xwaylandSurface->m_sizeHints->min_width, m_xwaylandSurface->m_sizeHints->min_height) : m_xdgSurface->m_toplevel->layoutMinSize(); |
