Commit 432c617d authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Revert "wayland: Simplify XdgSurfaceConfigure"

This reverts commit 110182b2.

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.
parent b7389c6f
......@@ -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;
......
......@@ -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)
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