Better painting of moved window.
svn path=/branches/work/kwin_composite/; revision=656410
This commit is contained in:
parent
7250a8edcd
commit
0040bb699b
3 changed files with 36 additions and 13 deletions
|
@ -179,6 +179,12 @@ Effects framework TODO
|
|||
|
||||
* check Scene::updateTimeDiff() - should the time be 0 or 1?
|
||||
|
||||
* DesktopGridEffect has somewhat broken stacking order while moving windows
|
||||
- the window is in proper layer when on its desktop but on top of everything when moved
|
||||
to another desktop, due to its desktop being painted later
|
||||
- maybe there should be PAINT_WINDOW_TOP (_LAST or whatever) that'd make it painted always
|
||||
on top of everything
|
||||
|
||||
|
||||
Effects TODO
|
||||
===============================
|
||||
|
|
|
@ -98,7 +98,11 @@ void DesktopGridEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* pai
|
|||
else
|
||||
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
||||
if( w == window_move )
|
||||
{
|
||||
*mask |= PAINT_WINDOW_TRANSFORMED;
|
||||
if( w->isOnAllDesktops() && painting_desktop != effects->currentDesktop())
|
||||
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
||||
}
|
||||
}
|
||||
effects->prePaintWindow( w, mask, paint, clip, time );
|
||||
}
|
||||
|
@ -115,23 +119,35 @@ void DesktopGridEffect::paintScreen( int mask, QRegion region, ScreenPaintData&
|
|||
paintSlide( mask, region, data );
|
||||
return;
|
||||
}
|
||||
int desktop_with_move = -1;
|
||||
if( window_move != NULL )
|
||||
desktop_with_move = window_move->isOnAllDesktops() ? effects->currentDesktop() : window_move->desktop();
|
||||
for( int desktop = 1;
|
||||
desktop <= effects->numberOfDesktops();
|
||||
++desktop )
|
||||
{
|
||||
QRect rect = desktopRect( desktop, true );
|
||||
if( region.contains( rect )) // this desktop needs painting
|
||||
{
|
||||
painting_desktop = desktop;
|
||||
ScreenPaintData d = data;
|
||||
QRect normal = desktopRect( effects->currentDesktop(), false );
|
||||
d.xTranslate += rect.x(); // - normal.x();
|
||||
d.yTranslate += rect.y(); // - normal.y();
|
||||
d.xScale *= rect.width() / float( normal.width());
|
||||
d.yScale *= rect.height() / float( normal.height());
|
||||
// TODO mask parts that are not visible?
|
||||
effects->paintScreen( mask, region, d );
|
||||
}
|
||||
if( desktop != desktop_with_move )
|
||||
paintScreenDesktop( desktop, mask, region, data );
|
||||
}
|
||||
// paint the desktop with the window being moved as the last one, i.e. on top of others
|
||||
if( desktop_with_move != -1 )
|
||||
paintScreenDesktop( desktop_with_move, mask, region, data );
|
||||
}
|
||||
|
||||
void DesktopGridEffect::paintScreenDesktop( int desktop, int mask, QRegion region, ScreenPaintData data )
|
||||
{
|
||||
QRect rect = desktopRect( desktop, true );
|
||||
if( region.contains( rect )) // this desktop needs painting
|
||||
{
|
||||
painting_desktop = desktop;
|
||||
ScreenPaintData d = data;
|
||||
QRect normal = desktopRect( effects->currentDesktop(), false );
|
||||
d.xTranslate += rect.x(); // - normal.x();
|
||||
d.yTranslate += rect.y(); // - normal.y();
|
||||
d.xScale *= rect.width() / float( normal.width());
|
||||
d.yScale *= rect.height() / float( normal.height());
|
||||
// TODO mask parts that are not visible?
|
||||
effects->paintScreen( mask, region, d );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ class DesktopGridEffect
|
|||
void setup();
|
||||
void finish();
|
||||
void paintSlide( int mask, QRegion region, const ScreenPaintData& data );
|
||||
void paintScreenDesktop( int desktop, int mask, QRegion region, ScreenPaintData data );
|
||||
void slideDesktopChanged( int old );
|
||||
float progress;
|
||||
bool activated;
|
||||
|
|
Loading…
Reference in a new issue