propagate the state (for example maximize) as required
svn path=/trunk/kdebase/kwin/; revision=54137
This commit is contained in:
parent
72abf668d2
commit
6ed208596c
2 changed files with 38 additions and 30 deletions
34
client.cpp
34
client.cpp
|
@ -63,12 +63,14 @@ public:
|
|||
m_client->setShade( state & NET::Shaded );
|
||||
|
||||
if ( mask & NET::Max ) {
|
||||
if ( state & NET::Max == NET::Max )
|
||||
if ( (state & NET::Max) == NET::Max )
|
||||
m_client->maximize( Client::MaximizeFull );
|
||||
else if ( state & NET::MaxVert )
|
||||
m_client->maximize( Client::MaximizeVertical );
|
||||
else if ( state & NET::MaxHoriz )
|
||||
m_client->maximize( Client::MaximizeHorizontal );
|
||||
else
|
||||
m_client->maximize( Client::MaximizeRestore );
|
||||
}
|
||||
}
|
||||
private:
|
||||
|
@ -1397,10 +1399,13 @@ void Client::maximize( MaximizeMode m)
|
|||
if (isShade())
|
||||
setShade( FALSE );
|
||||
|
||||
if (geom_restore.isNull()) {
|
||||
if ( !geom_restore.isNull() )
|
||||
m = MaximizeRestore;
|
||||
|
||||
if ( m != MaximizeRestore ) {
|
||||
Events::raise( Events::Maximize );
|
||||
geom_restore = geometry();
|
||||
}
|
||||
|
||||
switch (m) {
|
||||
|
||||
|
@ -1409,6 +1414,7 @@ void Client::maximize( MaximizeMode m)
|
|||
QRect(QPoint(x(), clientArea.top()),
|
||||
adjustedSize(QSize(width(), clientArea.height())))
|
||||
);
|
||||
info->setState( NET::MaxVert, NET::MaxVert );
|
||||
break;
|
||||
|
||||
case MaximizeHorizontal:
|
||||
|
@ -1418,24 +1424,26 @@ void Client::maximize( MaximizeMode m)
|
|||
QPoint(clientArea.left(), y()),
|
||||
adjustedSize(QSize(clientArea.width(), height())))
|
||||
);
|
||||
info->setState( NET::MaxHoriz, NET::MaxHoriz );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
setGeometry(
|
||||
QRect(clientArea.topLeft(), adjustedSize(clientArea.size()))
|
||||
);
|
||||
}
|
||||
|
||||
maximizeChange(true);
|
||||
|
||||
} else {
|
||||
case MaximizeRestore: {
|
||||
Events::raise( Events::UnMaximize );
|
||||
setGeometry(geom_restore);
|
||||
QRect invalid;
|
||||
geom_restore = invalid;
|
||||
maximizeChange(false);
|
||||
info->setState( 0, NET::Max );
|
||||
} break;
|
||||
|
||||
case MaximizeFull:
|
||||
|
||||
setGeometry(
|
||||
QRect(clientArea.topLeft(), adjustedSize(clientArea.size()))
|
||||
);
|
||||
info->setState( NET::Max, NET::Max );
|
||||
}
|
||||
|
||||
maximizeChange( m != MaximizeRestore );
|
||||
}
|
||||
|
||||
|
||||
|
|
2
client.h
2
client.h
|
@ -112,7 +112,7 @@ public:
|
|||
virtual void setShade( bool );
|
||||
|
||||
bool isMaximized() const;
|
||||
enum MaximizeMode { MaximizeVertical, MaximizeHorizontal, MaximizeFull };
|
||||
enum MaximizeMode { MaximizeVertical, MaximizeHorizontal, MaximizeFull, MaximizeRestore };
|
||||
|
||||
bool isSticky() const;
|
||||
void setSticky( bool );
|
||||
|
|
Loading…
Reference in a new issue