Revert "wayland: Simplify XdgSurfaceConfigure"

This reverts commit 110182b213.

The reverted commit has introduced a regression where interactively
moved windows jump back to their old position. This needs some time for
proper investigation. Due to beta rolling out quite soon, it will be
better to revert the change.
This commit is contained in:
Vlad Zahorodnii 2021-05-13 10:18:10 +03:00
parent b7389c6f1a
commit 432c617d10
2 changed files with 24 additions and 4 deletions

View file

@ -148,7 +148,16 @@ void XdgSurfaceClient::scheduleConfigure(ConfigureFlags flags)
void XdgSurfaceClient::sendConfigure()
{
m_configureEvents.append(sendRoleConfigure());
XdgSurfaceConfigure *configureEvent = sendRoleConfigure();
if (configureEvent->position != pos()) {
configureEvent->presentFields |= XdgSurfaceConfigure::PositionField;
}
if (configureEvent->size != size()) {
configureEvent->presentFields |= XdgSurfaceConfigure::SizeField;
}
m_configureEvents.append(configureEvent);
m_configureFlags = ConfigureFlags();
}
@ -217,10 +226,9 @@ void XdgSurfaceClient::handleNextWindowGeometry()
frameGeometry = adjustMoveResizeGeometry(frameGeometry);
} else if (lastAcknowledgedConfigure()) {
XdgSurfaceConfigure *configureEvent = lastAcknowledgedConfigure();
if (!m_plasmaShellSurface || !m_plasmaShellSurface->isPositionSet()) {
if (configureEvent->presentFields & XdgSurfaceConfigure::PositionField) {
frameGeometry.moveTopLeft(configureEvent->position);
} else {
frameGeometry.moveTopLeft(m_plasmaShellSurface->position());
}
}
@ -734,6 +742,7 @@ XdgSurfaceConfigure *XdgToplevelClient::sendRoleConfigure() const
XdgToplevelConfigure *configureEvent = new XdgToplevelConfigure();
configureEvent->position = requestedPos();
configureEvent->size = requestedSize();
configureEvent->states = m_requestedStates;
configureEvent->serial = serial;
@ -2023,6 +2032,7 @@ XdgSurfaceConfigure *XdgPopupClient::sendRoleConfigure() const
XdgSurfaceConfigure *configureEvent = new XdgSurfaceConfigure();
configureEvent->position = requestedPos();
configureEvent->size = requestedSize();
configureEvent->serial = serial;
return configureEvent;

View file

@ -36,7 +36,15 @@ class XdgSurfaceConfigure
public:
virtual ~XdgSurfaceConfigure() {}
enum ConfigureField {
PositionField = 0x1,
SizeField = 0x2,
};
Q_DECLARE_FLAGS(ConfigureFields, ConfigureField)
ConfigureFields presentFields;
QPoint position;
QSize size;
qreal serial;
};
@ -257,3 +265,5 @@ private:
};
} // namespace KWin
Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::XdgSurfaceConfigure::ConfigureFields)