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:
parent
a186e407bf
commit
d7b4d8fe82
4 changed files with 16 additions and 7 deletions
|
@ -1046,4 +1046,9 @@ void AbstractClient::addRepaintDuringGeometryUpdates()
|
|||
m_visibleRectBeforeGeometryUpdate = deco_rect;
|
||||
}
|
||||
|
||||
void AbstractClient::updateGeometryBeforeUpdateBlocking()
|
||||
{
|
||||
m_geometryBeforeUpdateBlocking = geom;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -577,6 +577,10 @@ protected:
|
|||
};
|
||||
PendingGeometry_t pendingGeometryUpdate() const;
|
||||
void setPendingGeometryUpdate(PendingGeometry_t update);
|
||||
QRect geometryBeforeUpdateBlocking() const {
|
||||
return m_geometryBeforeUpdateBlocking;
|
||||
}
|
||||
void updateGeometryBeforeUpdateBlocking();
|
||||
/**
|
||||
* Schedules a repaint for the visibleRect before and after a
|
||||
* geometry update. The current visibleRect is stored for the
|
||||
|
@ -628,6 +632,7 @@ private:
|
|||
PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone;
|
||||
friend class GeometryUpdatesBlocker;
|
||||
QRect m_visibleRectBeforeGeometryUpdate;
|
||||
QRect m_geometryBeforeUpdateBlocking;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
1
client.h
1
client.h
|
@ -698,7 +698,6 @@ private:
|
|||
xcb_timestamp_t m_userTime;
|
||||
NET::Actions allowed_actions;
|
||||
QSize client_size;
|
||||
QRect geom_before_block;
|
||||
bool shade_geometry_change;
|
||||
struct {
|
||||
xcb_sync_counter_t counter;
|
||||
|
|
12
geometry.cpp
12
geometry.cpp
|
@ -1925,7 +1925,7 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
|
|||
return;
|
||||
}
|
||||
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) {
|
||||
resizeDecoration();
|
||||
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 (oldClientSize != QSize(w,h))
|
||||
discardWindowPixmap();
|
||||
emit geometryShapeChanged(this, geom_before_block);
|
||||
emit geometryShapeChanged(this, geometryBeforeUpdateBlocking());
|
||||
}
|
||||
addRepaintDuringGeometryUpdates();
|
||||
geom_before_block = geom;
|
||||
updateGeometryBeforeUpdateBlocking();
|
||||
|
||||
// Update states of all other windows in this group
|
||||
if (tabGroup())
|
||||
|
@ -2030,9 +2030,9 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
|
|||
workspace()->updateStackingOrder();
|
||||
if (oldClientSize != QSize(w,h))
|
||||
discardWindowPixmap();
|
||||
emit geometryShapeChanged(this, geom_before_block);
|
||||
emit geometryShapeChanged(this, geometryBeforeUpdateBlocking());
|
||||
addRepaintDuringGeometryUpdates();
|
||||
geom_before_block = geom;
|
||||
updateGeometryBeforeUpdateBlocking();
|
||||
|
||||
// Update states of all other windows in this group
|
||||
if (tabGroup())
|
||||
|
@ -2075,7 +2075,7 @@ void Client::move(int x, int y, ForceGeometry_t force)
|
|||
}
|
||||
// client itself is not damaged
|
||||
addRepaintDuringGeometryUpdates();
|
||||
geom_before_block = geom;
|
||||
updateGeometryBeforeUpdateBlocking();
|
||||
|
||||
// Update states of all other windows in this group
|
||||
if (tabGroup())
|
||||
|
|
Loading…
Reference in a new issue