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
66
client.cpp
66
client.cpp
|
@ -63,12 +63,14 @@ public:
|
||||||
m_client->setShade( state & NET::Shaded );
|
m_client->setShade( state & NET::Shaded );
|
||||||
|
|
||||||
if ( mask & NET::Max ) {
|
if ( mask & NET::Max ) {
|
||||||
if ( state & NET::Max == NET::Max )
|
if ( (state & NET::Max) == NET::Max )
|
||||||
m_client->maximize( Client::MaximizeFull );
|
m_client->maximize( Client::MaximizeFull );
|
||||||
else if ( state & NET::MaxVert )
|
else if ( state & NET::MaxVert )
|
||||||
m_client->maximize( Client::MaximizeVertical );
|
m_client->maximize( Client::MaximizeVertical );
|
||||||
else if ( state & NET::MaxHoriz )
|
else if ( state & NET::MaxHoriz )
|
||||||
m_client->maximize( Client::MaximizeHorizontal );
|
m_client->maximize( Client::MaximizeHorizontal );
|
||||||
|
else
|
||||||
|
m_client->maximize( Client::MaximizeRestore );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
@ -1397,45 +1399,51 @@ void Client::maximize( MaximizeMode m)
|
||||||
if (isShade())
|
if (isShade())
|
||||||
setShade( FALSE );
|
setShade( FALSE );
|
||||||
|
|
||||||
if (geom_restore.isNull()) {
|
if ( !geom_restore.isNull() )
|
||||||
|
m = MaximizeRestore;
|
||||||
|
|
||||||
|
if ( m != MaximizeRestore ) {
|
||||||
Events::raise( Events::Maximize );
|
Events::raise( Events::Maximize );
|
||||||
geom_restore = geometry();
|
geom_restore = geometry();
|
||||||
|
}
|
||||||
|
|
||||||
switch (m) {
|
switch (m) {
|
||||||
|
|
||||||
case MaximizeVertical:
|
case MaximizeVertical:
|
||||||
setGeometry(
|
setGeometry(
|
||||||
QRect(QPoint(x(), clientArea.top()),
|
QRect(QPoint(x(), clientArea.top()),
|
||||||
adjustedSize(QSize(width(), clientArea.height())))
|
adjustedSize(QSize(width(), clientArea.height())))
|
||||||
);
|
);
|
||||||
break;
|
info->setState( NET::MaxVert, NET::MaxVert );
|
||||||
|
break;
|
||||||
|
|
||||||
case MaximizeHorizontal:
|
case MaximizeHorizontal:
|
||||||
|
|
||||||
setGeometry(
|
setGeometry(
|
||||||
QRect(
|
QRect(
|
||||||
QPoint(clientArea.left(), y()),
|
QPoint(clientArea.left(), y()),
|
||||||
adjustedSize(QSize(clientArea.width(), height())))
|
adjustedSize(QSize(clientArea.width(), height())))
|
||||||
);
|
);
|
||||||
break;
|
info->setState( NET::MaxHoriz, NET::MaxHoriz );
|
||||||
|
break;
|
||||||
default:
|
|
||||||
|
case MaximizeRestore: {
|
||||||
setGeometry(
|
|
||||||
QRect(clientArea.topLeft(), adjustedSize(clientArea.size()))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
maximizeChange(true);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Events::raise( Events::UnMaximize );
|
Events::raise( Events::UnMaximize );
|
||||||
setGeometry(geom_restore);
|
setGeometry(geom_restore);
|
||||||
QRect invalid;
|
QRect invalid;
|
||||||
geom_restore = 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 );
|
virtual void setShade( bool );
|
||||||
|
|
||||||
bool isMaximized() const;
|
bool isMaximized() const;
|
||||||
enum MaximizeMode { MaximizeVertical, MaximizeHorizontal, MaximizeFull };
|
enum MaximizeMode { MaximizeVertical, MaximizeHorizontal, MaximizeFull, MaximizeRestore };
|
||||||
|
|
||||||
bool isSticky() const;
|
bool isSticky() const;
|
||||||
void setSticky( bool );
|
void setSticky( bool );
|
||||||
|
|
Loading…
Reference in a new issue