Commit a186e407 authored by Martin Flöser's avatar Martin Flöser

Move handling around deco_rect_before_block to AbstractClient

The usage was always to trigger repaints on the old and the new
visibleRect. And store the new visibleRect as the future old one.

This is now encapsulated in a dedicated method called
addRepaintDuringGeometryUpdates().
parent 0c159e01
......@@ -1038,4 +1038,12 @@ bool AbstractClient::isDecorated() const
return false;
}
void AbstractClient::addRepaintDuringGeometryUpdates()
{
const QRect deco_rect = visibleRect();
addLayerRepaint(m_visibleRectBeforeGeometryUpdate);
addLayerRepaint(deco_rect); // trigger repaint of window's new location
m_visibleRectBeforeGeometryUpdate = deco_rect;
}
}
......@@ -577,6 +577,12 @@ protected:
};
PendingGeometry_t pendingGeometryUpdate() const;
void setPendingGeometryUpdate(PendingGeometry_t update);
/**
* Schedules a repaint for the visibleRect before and after a
* geometry update. The current visibleRect is stored for the
* next time this method is called as the before geometry.
**/
void addRepaintDuringGeometryUpdates();
private:
void handlePaletteChange();
......@@ -621,6 +627,7 @@ private:
int m_blockGeometryUpdates = 0; // > 0 = New geometry is remembered, but not actually set
PendingGeometry_t m_pendingGeometryUpdate = PendingGeometryNone;
friend class GeometryUpdatesBlocker;
QRect m_visibleRectBeforeGeometryUpdate;
};
/**
......
......@@ -699,7 +699,6 @@ private:
NET::Actions allowed_actions;
QSize client_size;
QRect geom_before_block;
QRect deco_rect_before_block;
bool shade_geometry_change;
struct {
xcb_sync_counter_t counter;
......
......@@ -1969,11 +1969,8 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
discardWindowPixmap();
emit geometryShapeChanged(this, geom_before_block);
}
const QRect deco_rect = visibleRect();
addLayerRepaint(deco_rect_before_block);
addLayerRepaint(deco_rect);
addRepaintDuringGeometryUpdates();
geom_before_block = geom;
deco_rect_before_block = deco_rect;
// Update states of all other windows in this group
if (tabGroup())
......@@ -2034,11 +2031,8 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
if (oldClientSize != QSize(w,h))
discardWindowPixmap();
emit geometryShapeChanged(this, geom_before_block);
const QRect deco_rect = visibleRect();
addLayerRepaint(deco_rect_before_block);
addLayerRepaint(deco_rect);
addRepaintDuringGeometryUpdates();
geom_before_block = geom;
deco_rect_before_block = deco_rect;
// Update states of all other windows in this group
if (tabGroup())
......@@ -2080,11 +2074,8 @@ void Client::move(int x, int y, ForceGeometry_t force)
Compositor::self()->checkUnredirect();
}
// client itself is not damaged
const QRect deco_rect = visibleRect();
addLayerRepaint(deco_rect_before_block);
addLayerRepaint(deco_rect); // trigger repaint of window's new location
addRepaintDuringGeometryUpdates();
geom_before_block = geom;
deco_rect_before_block = deco_rect;
// Update states of all other windows in this group
if (tabGroup())
......
Markdown is supported
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