Add some checks.
svn path=/trunk/kdebase/kwin/; revision=307285
This commit is contained in:
parent
d373e84e3a
commit
d05a7b068b
1 changed files with 12 additions and 4 deletions
|
@ -476,14 +476,14 @@ QRect Placement::checkArea( const Client* c, const QRect& area )
|
||||||
*/
|
*/
|
||||||
void Workspace::slotWindowPackLeft()
|
void Workspace::slotWindowPackLeft()
|
||||||
{
|
{
|
||||||
if( active_client )
|
if( active_client && active_client->isMovable())
|
||||||
active_client->move( packPositionLeft( active_client, active_client->geometry().left(), true ),
|
active_client->move( packPositionLeft( active_client, active_client->geometry().left(), true ),
|
||||||
active_client->y());
|
active_client->y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotWindowPackRight()
|
void Workspace::slotWindowPackRight()
|
||||||
{
|
{
|
||||||
if( active_client )
|
if( active_client && active_client->isMovable())
|
||||||
active_client->move(
|
active_client->move(
|
||||||
packPositionRight( active_client, active_client->geometry().right(), true )
|
packPositionRight( active_client, active_client->geometry().right(), true )
|
||||||
- active_client->width() + 1, active_client->y());
|
- active_client->width() + 1, active_client->y());
|
||||||
|
@ -491,14 +491,14 @@ void Workspace::slotWindowPackRight()
|
||||||
|
|
||||||
void Workspace::slotWindowPackUp()
|
void Workspace::slotWindowPackUp()
|
||||||
{
|
{
|
||||||
if( active_client )
|
if( active_client && active_client->isMovable())
|
||||||
active_client->move( active_client->x(),
|
active_client->move( active_client->x(),
|
||||||
packPositionUp( active_client, active_client->geometry().top(), true ));
|
packPositionUp( active_client, active_client->geometry().top(), true ));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotWindowPackDown()
|
void Workspace::slotWindowPackDown()
|
||||||
{
|
{
|
||||||
if( active_client )
|
if( active_client && active_client->isMovable())
|
||||||
active_client->move( active_client->x(),
|
active_client->move( active_client->x(),
|
||||||
packPositionDown( active_client, active_client->geometry().bottom(), true ) - active_client->height() + 1 );
|
packPositionDown( active_client, active_client->geometry().bottom(), true ) - active_client->height() + 1 );
|
||||||
}
|
}
|
||||||
|
@ -511,6 +511,8 @@ void Workspace::slotWindowGrowHorizontal()
|
||||||
|
|
||||||
void Client::growHorizontal()
|
void Client::growHorizontal()
|
||||||
{
|
{
|
||||||
|
if( !isResizable())
|
||||||
|
return;
|
||||||
QRect geom = geometry();
|
QRect geom = geometry();
|
||||||
geom.setRight( workspace()->packPositionRight( this, geom.right(), true ));
|
geom.setRight( workspace()->packPositionRight( this, geom.right(), true ));
|
||||||
QSize adjsize = adjustedSize( geom.size(), SizemodeFixedW );
|
QSize adjsize = adjustedSize( geom.size(), SizemodeFixedW );
|
||||||
|
@ -535,6 +537,8 @@ void Workspace::slotWindowShrinkHorizontal()
|
||||||
|
|
||||||
void Client::shrinkHorizontal()
|
void Client::shrinkHorizontal()
|
||||||
{
|
{
|
||||||
|
if( !isResizable())
|
||||||
|
return;
|
||||||
QRect geom = geometry();
|
QRect geom = geometry();
|
||||||
geom.setRight( workspace()->packPositionLeft( this, geom.right(), false ));
|
geom.setRight( workspace()->packPositionLeft( this, geom.right(), false ));
|
||||||
if( geom.width() <= 1 )
|
if( geom.width() <= 1 )
|
||||||
|
@ -552,6 +556,8 @@ void Workspace::slotWindowGrowVertical()
|
||||||
|
|
||||||
void Client::growVertical()
|
void Client::growVertical()
|
||||||
{
|
{
|
||||||
|
if( !isResizable())
|
||||||
|
return;
|
||||||
QRect geom = geometry();
|
QRect geom = geometry();
|
||||||
geom.setBottom( workspace()->packPositionDown( this, geom.bottom(), true ));
|
geom.setBottom( workspace()->packPositionDown( this, geom.bottom(), true ));
|
||||||
QSize adjsize = adjustedSize( geom.size(), SizemodeFixedH );
|
QSize adjsize = adjustedSize( geom.size(), SizemodeFixedH );
|
||||||
|
@ -576,6 +582,8 @@ void Workspace::slotWindowShrinkVertical()
|
||||||
|
|
||||||
void Client::shrinkVertical()
|
void Client::shrinkVertical()
|
||||||
{
|
{
|
||||||
|
if( !isResizable())
|
||||||
|
return;
|
||||||
QRect geom = geometry();
|
QRect geom = geometry();
|
||||||
geom.setBottom( workspace()->packPositionUp( this, geom.bottom(), false ));
|
geom.setBottom( workspace()->packPositionUp( this, geom.bottom(), false ));
|
||||||
if( geom.height() <= 1 )
|
if( geom.height() <= 1 )
|
||||||
|
|
Loading…
Reference in a new issue