window: fix requestedMinSize crash (#11498)
There are cases where m_isX11 is true but m_xwaylandSurface doesn't exist.
This commit is contained in:
parent
50a242f16a
commit
42caff5587
1 changed files with 3 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue