Commit d388e3ff authored by Thomas Lübking's avatar Thomas Lübking
Browse files

snaphelper: repaint center rect on resizing client

BUG: 311551
FIXED-IN: 4.10
REVIEW: 108005
parent 1fefaa9e
......@@ -39,6 +39,7 @@ SnapHelperEffect::SnapHelperEffect()
connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*)));
connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*)));
connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*)));
connect(effects, SIGNAL(windowGeometryShapeChanged(KWin::EffectWindow*, const QRect&)), this, SLOT(slotWindowResized(KWin::EffectWindow*, const QRect&)));
/*if ( effects->compositingType() == XRenderCompositing )
{
......@@ -94,7 +95,7 @@ void SnapHelperEffect::postPaintScreen()
glLineWidth(4.0);
QVector<float> verts;
verts.reserve(effects->numScreens() * 24);
for (int i = 0; i < effects->numScreens(); i++) {
for (int i = 0; i < effects->numScreens(); ++i) {
const QRect& rect = effects->clientArea(ScreenArea, i, 0);
int midX = rect.x() + rect.width() / 2;
int midY = rect.y() + rect.height() / 2 ;
......@@ -126,7 +127,7 @@ void SnapHelperEffect::postPaintScreen()
}
if ( effects->compositingType() == XRenderCompositing ) {
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
for ( int i = 0; i < effects->numScreens(); i++ ) {
for (int i = 0; i < effects->numScreens(); ++i) {
const QRect& rect = effects->clientArea( ScreenArea, i, 0 );
int midX = rect.x() + rect.width() / 2;
int midY = rect.y() + rect.height() / 2 ;
......@@ -201,6 +202,17 @@ void SnapHelperEffect::slotWindowFinishUserMovedResized(EffectWindow *w)
}
}
void SnapHelperEffect::slotWindowResized(KWin::EffectWindow *w, const QRect &oldRect)
{
if (w == m_window) {
QRect r(oldRect);
for (int i = 0; i < effects->numScreens(); ++i) {
r.moveCenter(effects->clientArea( ScreenArea, i, 0 ).center());
effects->addRepaint(r);
}
}
}
bool SnapHelperEffect::isActive() const
{
return m_active || m_timeline.currentValue() != 0.0;
......
......@@ -45,6 +45,7 @@ public Q_SLOTS:
void slotWindowClosed(KWin::EffectWindow *w);
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
void slotWindowFinishUserMovedResized(KWin::EffectWindow *w);
void slotWindowResized(KWin::EffectWindow *w, const QRect &r);
private:
bool m_active;
......
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