Commit 6182744a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Add support for xdg_toplevel.configure_bounds()

With the xdg_toplevel.configure_bounds event, the compositor will be
able to indicate the client the maximum desired surface size.

It can be used to prevent mapping too big application windows, etc.
parent 88e36d0b
Pipeline #137159 passed with stage
in 13 minutes and 46 seconds
......@@ -831,12 +831,23 @@ void XdgToplevelClient::closeWindow()
XdgSurfaceConfigure *XdgToplevelClient::sendRoleConfigure() const
{
QSize framePadding(0, 0);
if (m_nextDecoration) {
framePadding.setWidth(m_nextDecoration->borderLeft() + m_nextDecoration->borderRight());
framePadding.setHeight(m_nextDecoration->borderTop() + m_nextDecoration->borderBottom());
}
QSize nextClientSize = moveResizeGeometry().size();
if (!nextClientSize.isEmpty()) {
if (m_nextDecoration) {
nextClientSize.rwidth() -= m_nextDecoration->borderLeft() + m_nextDecoration->borderRight();
nextClientSize.rheight() -= m_nextDecoration->borderTop() + m_nextDecoration->borderBottom();
}
nextClientSize.rwidth() -= framePadding.width();
nextClientSize.rheight() -= framePadding.height();
}
if (nextClientSize.isEmpty()) {
QSize bounds = workspace()->clientArea(PlacementArea, this, output()).size();
bounds.rwidth() -= framePadding.width();
bounds.rheight() -= framePadding.height();
m_shellSurface->sendConfigureBounds(bounds);
}
const quint32 serial = m_shellSurface->sendConfigure(nextClientSize, m_nextStates);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment