TilingLayout::clientResized() returns boolean argument.
If resize was attempted it returns true. This way layouts can use the default implementation to handle floating windows or unchanged geometry. The commit() call in the default implementation is also avoided svn path=/trunk/KDE/kdebase/workspace/; revision=1148579
This commit is contained in:
parent
44a1637e0d
commit
5ab491ab1f
4 changed files with 11 additions and 11 deletions
|
@ -66,20 +66,19 @@ void TilingLayout::clientMinimizeToggled( Client *c )
|
|||
arrange( layoutArea( t ) );
|
||||
}
|
||||
|
||||
void TilingLayout::clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig )
|
||||
bool TilingLayout::clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig )
|
||||
{
|
||||
if( moveResizeGeom == orig )
|
||||
return;
|
||||
return true;
|
||||
|
||||
Tile *t = findTile( c );
|
||||
if( !t || t->ignoreGeometry() )
|
||||
{
|
||||
c->setGeometry( moveResizeGeom );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
t->setGeometry( moveResizeGeom );
|
||||
commit();
|
||||
return false;
|
||||
}
|
||||
|
||||
// tries to swap the tile with the one in the new position right now
|
||||
|
|
|
@ -42,8 +42,9 @@ class TilingLayout
|
|||
/**
|
||||
* Reimplement this to decide how the client(s) should
|
||||
* be resized.
|
||||
* Return true if an actual resize was attempted, false if not ( for whatever reason )
|
||||
*/
|
||||
virtual void clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig );
|
||||
virtual bool clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig );
|
||||
void clientMoved( Client *c, const QRect &moveResizeGeom, const QRect &orig );
|
||||
void clientMinimizeToggled( Client *c );
|
||||
|
||||
|
|
|
@ -82,13 +82,12 @@ KDecorationDefines::Position Columns::resizeMode( Client *c, KDecorationDefines:
|
|||
return KDecorationDefines::PositionCenter;
|
||||
}
|
||||
|
||||
void Columns::clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig )
|
||||
bool Columns::clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig )
|
||||
{
|
||||
TilingLayout::clientResized( c, moveResizeGeom, orig );
|
||||
if( TilingLayout::clientResized( c, moveResizeGeom, orig ) )
|
||||
return true;
|
||||
|
||||
Tile *t = findTile( c );
|
||||
if( t->ignoreGeometry() )
|
||||
return;
|
||||
|
||||
QList<Tile *> tiled( tiles() );
|
||||
|
||||
|
@ -110,6 +109,7 @@ void Columns::clientResized( Client *c, const QRect &moveResizeGeom, const QRect
|
|||
}
|
||||
|
||||
arrange( layoutArea( t ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void Columns::arrange( QRect wgeom )
|
||||
|
|
|
@ -38,7 +38,7 @@ class Columns : public TilingLayout
|
|||
public:
|
||||
Columns( Workspace * );
|
||||
KDecorationDefines::Position resizeMode( Client *c, KDecorationDefines::Position currentMode ) const;
|
||||
void clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig );
|
||||
bool clientResized( Client *c, const QRect &moveResizeGeom, const QRect &orig );
|
||||
|
||||
private:
|
||||
void arrange( QRect wgeom );
|
||||
|
|
Loading…
Reference in a new issue