diff options
Diffstat (limited to 'src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp')
-rw-r--r-- | src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 8b3d07481..0756e4d02 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -82,9 +82,6 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen))) m_normalSize = m_xdgSurface->m_window->window()->frameGeometry().size(); - if (m_pending.size.isEmpty() && !m_normalSize.isEmpty()) - m_pending.size = m_normalSize; - if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive)) m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window); @@ -95,10 +92,20 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() Qt::WindowStates statesWithoutActive = m_pending.states & ~Qt::WindowActive; m_xdgSurface->m_window->handleWindowStatesChanged(statesWithoutActive); - m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size); + + if (m_pending.size.isEmpty()) { + // An empty size in the configure means it's up to the client to choose the size + bool normalPending = !(m_pending.states & (Qt::WindowMaximized|Qt::WindowFullScreen)); + if (normalPending && !m_normalSize.isEmpty()) + m_xdgSurface->m_window->resizeFromApplyConfigure(m_normalSize); + } else { + m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size); + } + QSize windowGeometrySize = m_xdgSurface->m_window->window()->frameGeometry().size(); m_xdgSurface->set_window_geometry(0, 0, windowGeometrySize.width(), windowGeometrySize.height()); m_applied = m_pending; + qCDebug(lcQpaWayland) << "Applied pending xdg_toplevel configure event:" << m_applied.size << m_applied.states; } bool QWaylandXdgSurface::Toplevel::wantsDecorations() |