Added TilingLayout::reconfigureTiling which respects per window tiling settings and is capable of updating them on the fly by being called from slotReconfigure

svn path=/trunk/KDE/kdebase/workspace/; revision=1123173
This commit is contained in:
Nikhil Marathe 2010-05-05 13:52:09 +00:00
parent ef02e261ae
commit f7c3b38402
3 changed files with 30 additions and 0 deletions

View file

@ -126,6 +126,8 @@ void TilingLayout::swapTiles( Tile *a, Tile *b )
void TilingLayout::addTileNoArrange( Tile * t )
{
if( findTile( t->client() ) )
return;
m_tiles.append( t );
postAddTile( t );
}
@ -179,6 +181,28 @@ void TilingLayout::toggleFloatTile( Client *c )
arrange( layoutArea( t ) );
}
void TilingLayout::reconfigureTiling()
{
//TODO also check 'untiled' windows to see if they are now requesting tiling
foreach( Tile *t, tiles() )
{
if( t->client()->rules()->checkTilingOption( t->floating() ? 1 : 0 ) == 1 )
t->floatTile();
else
t->unfloatTile();
}
if( tiles().length() > 0 )
arrange( layoutArea( tiles().first() ) );
foreach( Client *c, workspace()->stackingOrder() )
{
if( c->rules()->checkTilingOption( 0 ) == 1 )
workspace()->createTile( c );
}
}
Tile* TilingLayout::findTileBelowPoint( const QPoint &p ) const
{
foreach( Tile *t, tiles() )

View file

@ -54,6 +54,7 @@ class TilingLayout
void removeTile( Client *c );
void toggleFloatTile( Client *c );
void swapTiles( Tile *a, Tile *b );
void reconfigureTiling();
virtual KDecorationDefines::Position resizeMode( Client *c, KDecorationDefines::Position currentMode ) const;

View file

@ -1152,6 +1152,11 @@ void Workspace::slotReconfigure()
}
setTilingEnabled( options->tilingOn );
foreach( TilingLayout *layout, tilingLayouts )
{
if( layout )
layout->reconfigureTiling();
}
// just so that we reset windows in the right manner, 'activate' the current active window
notifyWindowActivated( activeClient() );
rootInfo->setSupported( NET::WM2FrameOverlap, mgr->factory()->supports( AbilityExtendIntoClientArea ) );