Use better name for geometryBeforeUpdateBlocking

Summary:
Rename geometryBeforeUpdateBlocking in order to better reflect that it
corresponds to the last frame geometry.

Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24658
This commit is contained in:
Vlad Zahorodnii 2019-10-10 14:49:11 +03:00
parent fb2d4c113f
commit e2f82d793b
5 changed files with 15 additions and 12 deletions

View file

@ -1306,9 +1306,14 @@ void AbstractClient::addRepaintDuringGeometryUpdates()
m_visibleRectBeforeGeometryUpdate = deco_rect;
}
QRect AbstractClient::frameGeometryBeforeUpdateBlocking() const
{
return m_frameGeometryBeforeUpdateBlocking;
}
void AbstractClient::updateGeometryBeforeUpdateBlocking()
{
m_geometryBeforeUpdateBlocking = frameGeometry();
m_frameGeometryBeforeUpdateBlocking = frameGeometry();
}
void AbstractClient::doMove(int, int)

View file

@ -1000,9 +1000,7 @@ protected:
};
PendingGeometry_t pendingGeometryUpdate() const;
void setPendingGeometryUpdate(PendingGeometry_t update);
QRect geometryBeforeUpdateBlocking() const {
return m_geometryBeforeUpdateBlocking;
}
QRect frameGeometryBeforeUpdateBlocking() const;
void updateGeometryBeforeUpdateBlocking();
/**
* Schedules a repaint for the visibleRect before and after a
@ -1220,7 +1218,7 @@ private:
PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone;
friend class GeometryUpdatesBlocker;
QRect m_visibleRectBeforeGeometryUpdate;
QRect m_geometryBeforeUpdateBlocking;
QRect m_frameGeometryBeforeUpdateBlocking;
QRect m_virtualKeyboardGeometry;
QRect m_keyboardGeometryRestore;

View file

@ -1967,7 +1967,7 @@ void X11Client::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t for
return;
}
QSize oldClientSize = m_frame.geometry().size();
bool resized = (geometryBeforeUpdateBlocking().size() != geom.size() || pendingGeometryUpdate() == PendingGeometryForced);
bool resized = (frameGeometryBeforeUpdateBlocking().size() != geom.size() || pendingGeometryUpdate() == PendingGeometryForced);
if (resized) {
resizeDecoration();
m_frame.setGeometry(x, y, w, h);
@ -2008,7 +2008,7 @@ void X11Client::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t for
if (oldClientSize != QSize(w,h))
discardWindowPixmap();
}
emit geometryShapeChanged(this, geometryBeforeUpdateBlocking());
emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking());
addRepaintDuringGeometryUpdates();
updateGeometryBeforeUpdateBlocking();
// TODO: this signal is emitted too often
@ -2065,7 +2065,7 @@ void X11Client::plainResize(int w, int h, ForceGeometry_t force)
workspace()->updateStackingOrder();
if (oldClientSize != QSize(w,h))
discardWindowPixmap();
emit geometryShapeChanged(this, geometryBeforeUpdateBlocking());
emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking());
addRepaintDuringGeometryUpdates();
updateGeometryBeforeUpdateBlocking();
// TODO: this signal is emitted too often

View file

@ -349,7 +349,7 @@ void InternalClient::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_
if (pendingGeometryUpdate() != PendingGeometryNone) {
// Reset geometry to the one before blocking, so that we can compare properly.
geom = geometryBeforeUpdateBlocking();
geom = frameGeometryBeforeUpdateBlocking();
}
if (geom == rect) {
@ -633,7 +633,7 @@ void InternalClient::commitGeometry(const QRect &rect)
addWorkspaceRepaint(visibleRect());
syncGeometryToInternalWindow();
const QRect oldGeometry = geometryBeforeUpdateBlocking();
const QRect oldGeometry = frameGeometryBeforeUpdateBlocking();
updateGeometryBeforeUpdateBlocking();
emit geometryShapeChanged(this, oldGeometry);

View file

@ -490,7 +490,7 @@ void XdgShellClient::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_
if (pendingGeometryUpdate() != PendingGeometryNone) {
// reset geometry to the one before blocking, so that we can compare properly
geom = geometryBeforeUpdateBlocking();
geom = frameGeometryBeforeUpdateBlocking();
}
const QSize requestedClientSize = newGeometry.size() - QSize(borderLeft() + borderRight(), borderTop() + borderBottom());
@ -552,7 +552,7 @@ void XdgShellClient::doSetGeometry(const QRect &rect)
updateWindowRules(Rules::Position | Rules::Size);
}
const auto old = geometryBeforeUpdateBlocking();
const auto old = frameGeometryBeforeUpdateBlocking();
addRepaintDuringGeometryUpdates();
updateGeometryBeforeUpdateBlocking();
emit geometryShapeChanged(this, old);