Make Client::iconGeometry() recursively use it's mainwindow's icongeometry if it
doesn't have one itself. svn path=/branches/work/kwin_composite/; revision=628327
This commit is contained in:
parent
3003c4ecf8
commit
cc93b859e3
3 changed files with 16 additions and 22 deletions
16
client.cpp
16
client.cpp
|
@ -601,7 +601,21 @@ void Client::unminimize( bool avoid_animation )
|
||||||
QRect Client::iconGeometry() const
|
QRect Client::iconGeometry() const
|
||||||
{
|
{
|
||||||
NETRect r = info->iconGeometry();
|
NETRect r = info->iconGeometry();
|
||||||
return QRect( r.pos.x, r.pos.y, r.size.width, r.size.height );
|
QRect geom( r.pos.x, r.pos.y, r.size.width, r.size.height );
|
||||||
|
if( geom.isValid() )
|
||||||
|
return geom;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Check all mainwindows of this window (recursively)
|
||||||
|
foreach( Client* mainwin, mainClients() )
|
||||||
|
{
|
||||||
|
geom = mainwin->iconGeometry();
|
||||||
|
if( geom.isValid() )
|
||||||
|
return geom;
|
||||||
|
}
|
||||||
|
// No mainwindow (or their parents) with icon geometry was found
|
||||||
|
return QRect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool blockAnimation;
|
extern bool blockAnimation;
|
||||||
|
|
|
@ -83,14 +83,7 @@ void MinimizeAnimationEffect::paintWindow( EffectWindow* w, int mask, QRegion re
|
||||||
Client* c = static_cast< Client* >( w->window() );
|
Client* c = static_cast< Client* >( w->window() );
|
||||||
QRect geo = c->geometry();
|
QRect geo = c->geometry();
|
||||||
QRect icon = c->iconGeometry();
|
QRect icon = c->iconGeometry();
|
||||||
// For dialogs, try to use parent window's taskbar entry
|
// If there's no icon geometry, minimize to the center of the screen
|
||||||
if( !icon.isValid() )
|
|
||||||
{
|
|
||||||
Client* parent = findParentWithIconGeometry( c );
|
|
||||||
if( parent )
|
|
||||||
icon = parent->iconGeometry();
|
|
||||||
}
|
|
||||||
// If everything else fails, minimize to the center of the screen
|
|
||||||
if( !icon.isValid() )
|
if( !icon.isValid() )
|
||||||
icon = QRect( displayWidth() / 2, displayHeight() / 2, 0, 0 );
|
icon = QRect( displayWidth() / 2, displayHeight() / 2, 0, 0 );
|
||||||
|
|
||||||
|
@ -132,15 +125,5 @@ void MinimizeAnimationEffect::windowUnminimized( EffectWindow* w )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Client* MinimizeAnimationEffect::findParentWithIconGeometry( Client* c )
|
|
||||||
{
|
|
||||||
if( c->iconGeometry().isValid() )
|
|
||||||
return c;
|
|
||||||
else if( c->transientFor() )
|
|
||||||
return findParentWithIconGeometry( c->transientFor() );
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,6 @@ class MinimizeAnimationEffect
|
||||||
virtual void windowMinimized( EffectWindow* c );
|
virtual void windowMinimized( EffectWindow* c );
|
||||||
virtual void windowUnminimized( EffectWindow* c );
|
virtual void windowUnminimized( EffectWindow* c );
|
||||||
|
|
||||||
protected:
|
|
||||||
Client* findParentWithIconGeometry( Client* c );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Workspace* mWorkspace;
|
Workspace* mWorkspace;
|
||||||
QMap< EffectWindow*, float > mAnimationProgress;
|
QMap< EffectWindow*, float > mAnimationProgress;
|
||||||
|
|
Loading…
Reference in a new issue