Backport svn commit 449791
svn path=/trunk/KDE/kdebase/kwin/; revision=449793
This commit is contained in:
parent
c6b24fdb13
commit
b5ff06d5f8
2 changed files with 26 additions and 0 deletions
7
client.h
7
client.h
|
@ -127,6 +127,7 @@ class Client : public QObject, public KDecorationDefines
|
|||
bool isMinimized() const;
|
||||
bool isMaximizable() const;
|
||||
QRect geometryRestore() const;
|
||||
MaximizeMode maximizeModeRestore() const;
|
||||
MaximizeMode maximizeMode() const;
|
||||
bool isMinimizable() const;
|
||||
void setMaximize( bool vertically, bool horizontally );
|
||||
|
@ -501,6 +502,7 @@ class Client : public QObject, public KDecorationDefines
|
|||
MaximizeMode max_mode;
|
||||
QRect geom_restore;
|
||||
QRect geom_fs_restore;
|
||||
MaximizeMode maxmode_restore;
|
||||
int workarea_diff_x, workarea_diff_y;
|
||||
WinInfo* info;
|
||||
QTimer* autoRaiseTimer;
|
||||
|
@ -722,6 +724,11 @@ inline QRect Client::geometryRestore() const
|
|||
return geom_restore;
|
||||
}
|
||||
|
||||
inline Client::MaximizeMode Client::maximizeModeRestore() const
|
||||
{
|
||||
return maxmode_restore;
|
||||
}
|
||||
|
||||
inline Client::MaximizeMode Client::maximizeMode() const
|
||||
{
|
||||
return max_mode;
|
||||
|
|
19
geometry.cpp
19
geometry.cpp
|
@ -1838,6 +1838,21 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
|
|||
if( decoration != NULL ) // decorations may turn off some borders when maximized
|
||||
decoration->borders( border_left, border_right, border_top, border_bottom );
|
||||
|
||||
// restore partial maximizations
|
||||
if ( old_mode==MaximizeFull && max_mode==MaximizeRestore )
|
||||
{
|
||||
if ( maximizeModeRestore()==MaximizeVertical )
|
||||
{
|
||||
max_mode = MaximizeVertical;
|
||||
maxmode_restore = MaximizeRestore;
|
||||
}
|
||||
if ( maximizeModeRestore()==MaximizeHorizontal )
|
||||
{
|
||||
max_mode = MaximizeHorizontal;
|
||||
maxmode_restore = MaximizeRestore;
|
||||
}
|
||||
}
|
||||
|
||||
switch (max_mode)
|
||||
{
|
||||
|
||||
|
@ -1917,6 +1932,10 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
|
|||
|
||||
case MaximizeFull:
|
||||
{
|
||||
if( old_mode & MaximizeVertical )
|
||||
maxmode_restore = MaximizeVertical;
|
||||
if( old_mode & MaximizeHorizontal )
|
||||
maxmode_restore = MaximizeHorizontal;
|
||||
QSize adjSize = adjustedSize(clientArea.size(), SizemodeMax );
|
||||
QRect r = QRect(clientArea.topLeft(), adjSize);
|
||||
setGeometry( r );
|
||||
|
|
Loading…
Reference in a new issue