snaphelper: repaint center rect on resizing client
BUG: 311551 FIXED-IN: 4.10 REVIEW: 108005
This commit is contained in:
parent
708df9b564
commit
dcab3d44f3
2 changed files with 15 additions and 2 deletions
|
@ -39,6 +39,7 @@ SnapHelperEffect::SnapHelperEffect()
|
||||||
connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*)));
|
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(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*)));
|
||||||
connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(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 )
|
/*if ( effects->compositingType() == XRenderCompositing )
|
||||||
{
|
{
|
||||||
|
@ -94,7 +95,7 @@ void SnapHelperEffect::postPaintScreen()
|
||||||
glLineWidth(4.0);
|
glLineWidth(4.0);
|
||||||
QVector<float> verts;
|
QVector<float> verts;
|
||||||
verts.reserve(effects->numScreens() * 24);
|
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);
|
const QRect& rect = effects->clientArea(ScreenArea, i, 0);
|
||||||
int midX = rect.x() + rect.width() / 2;
|
int midX = rect.x() + rect.width() / 2;
|
||||||
int midY = rect.y() + rect.height() / 2 ;
|
int midY = rect.y() + rect.height() / 2 ;
|
||||||
|
@ -126,7 +127,7 @@ void SnapHelperEffect::postPaintScreen()
|
||||||
}
|
}
|
||||||
if ( effects->compositingType() == XRenderCompositing ) {
|
if ( effects->compositingType() == XRenderCompositing ) {
|
||||||
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
|
#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 );
|
const QRect& rect = effects->clientArea( ScreenArea, i, 0 );
|
||||||
int midX = rect.x() + rect.width() / 2;
|
int midX = rect.x() + rect.width() / 2;
|
||||||
int midY = rect.y() + rect.height() / 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
|
bool SnapHelperEffect::isActive() const
|
||||||
{
|
{
|
||||||
return m_active || m_timeline.currentValue() != 0.0;
|
return m_active || m_timeline.currentValue() != 0.0;
|
||||||
|
|
|
@ -45,6 +45,7 @@ public Q_SLOTS:
|
||||||
void slotWindowClosed(KWin::EffectWindow *w);
|
void slotWindowClosed(KWin::EffectWindow *w);
|
||||||
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
||||||
void slotWindowFinishUserMovedResized(KWin::EffectWindow *w);
|
void slotWindowFinishUserMovedResized(KWin::EffectWindow *w);
|
||||||
|
void slotWindowResized(KWin::EffectWindow *w, const QRect &r);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_active;
|
bool m_active;
|
||||||
|
|
Loading…
Reference in a new issue