Move functionality for geom_before_block to AbstractClient

Semantically it belongs together with geometry update blocking which
is already in AbstractClient.
This commit is contained in:
Martin Gräßlin 2015-10-15 13:11:21 +02:00
parent a186e407bf
commit d7b4d8fe82
4 changed files with 16 additions and 7 deletions

View file

@ -1046,4 +1046,9 @@ void AbstractClient::addRepaintDuringGeometryUpdates()
m_visibleRectBeforeGeometryUpdate = deco_rect; m_visibleRectBeforeGeometryUpdate = deco_rect;
} }
void AbstractClient::updateGeometryBeforeUpdateBlocking()
{
m_geometryBeforeUpdateBlocking = geom;
}
} }

View file

@ -577,6 +577,10 @@ protected:
}; };
PendingGeometry_t pendingGeometryUpdate() const; PendingGeometry_t pendingGeometryUpdate() const;
void setPendingGeometryUpdate(PendingGeometry_t update); void setPendingGeometryUpdate(PendingGeometry_t update);
QRect geometryBeforeUpdateBlocking() const {
return m_geometryBeforeUpdateBlocking;
}
void updateGeometryBeforeUpdateBlocking();
/** /**
* Schedules a repaint for the visibleRect before and after a * Schedules a repaint for the visibleRect before and after a
* geometry update. The current visibleRect is stored for the * geometry update. The current visibleRect is stored for the
@ -628,6 +632,7 @@ private:
PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone; PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone;
friend class GeometryUpdatesBlocker; friend class GeometryUpdatesBlocker;
QRect m_visibleRectBeforeGeometryUpdate; QRect m_visibleRectBeforeGeometryUpdate;
QRect m_geometryBeforeUpdateBlocking;
}; };
/** /**

View file

@ -698,7 +698,6 @@ private:
xcb_timestamp_t m_userTime; xcb_timestamp_t m_userTime;
NET::Actions allowed_actions; NET::Actions allowed_actions;
QSize client_size; QSize client_size;
QRect geom_before_block;
bool shade_geometry_change; bool shade_geometry_change;
struct { struct {
xcb_sync_counter_t counter; xcb_sync_counter_t counter;

View file

@ -1925,7 +1925,7 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
return; return;
} }
QSize oldClientSize = m_frame.geometry().size(); QSize oldClientSize = m_frame.geometry().size();
bool resized = (geom_before_block.size() != geom.size() || pendingGeometryUpdate() == PendingGeometryForced); bool resized = (geometryBeforeUpdateBlocking().size() != geom.size() || pendingGeometryUpdate() == PendingGeometryForced);
if (resized) { if (resized) {
resizeDecoration(); resizeDecoration();
m_frame.setGeometry(x, y, w, h); m_frame.setGeometry(x, y, w, h);
@ -1967,10 +1967,10 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
if (resized) { if (resized) {
if (oldClientSize != QSize(w,h)) if (oldClientSize != QSize(w,h))
discardWindowPixmap(); discardWindowPixmap();
emit geometryShapeChanged(this, geom_before_block); emit geometryShapeChanged(this, geometryBeforeUpdateBlocking());
} }
addRepaintDuringGeometryUpdates(); addRepaintDuringGeometryUpdates();
geom_before_block = geom; updateGeometryBeforeUpdateBlocking();
// Update states of all other windows in this group // Update states of all other windows in this group
if (tabGroup()) if (tabGroup())
@ -2030,9 +2030,9 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
workspace()->updateStackingOrder(); workspace()->updateStackingOrder();
if (oldClientSize != QSize(w,h)) if (oldClientSize != QSize(w,h))
discardWindowPixmap(); discardWindowPixmap();
emit geometryShapeChanged(this, geom_before_block); emit geometryShapeChanged(this, geometryBeforeUpdateBlocking());
addRepaintDuringGeometryUpdates(); addRepaintDuringGeometryUpdates();
geom_before_block = geom; updateGeometryBeforeUpdateBlocking();
// Update states of all other windows in this group // Update states of all other windows in this group
if (tabGroup()) if (tabGroup())
@ -2075,7 +2075,7 @@ void Client::move(int x, int y, ForceGeometry_t force)
} }
// client itself is not damaged // client itself is not damaged
addRepaintDuringGeometryUpdates(); addRepaintDuringGeometryUpdates();
geom_before_block = geom; updateGeometryBeforeUpdateBlocking();
// Update states of all other windows in this group // Update states of all other windows in this group
if (tabGroup()) if (tabGroup())