diff options
Diffstat (limited to 'tdeui/tdemainwindow.cpp')
-rw-r--r-- | tdeui/tdemainwindow.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/tdeui/tdemainwindow.cpp b/tdeui/tdemainwindow.cpp index ba9c51556..a5dde30e3 100644 --- a/tdeui/tdemainwindow.cpp +++ b/tdeui/tdemainwindow.cpp @@ -955,16 +955,26 @@ void TDEMainWindow::restoreWindowSize( TDEConfig * config ) } if ( !size.isEmpty() ) { #ifdef Q_WS_X11 - int state = ( size.width() > desk.width() ? NET::MaxHoriz : 0 ) - | ( size.height() > desk.height() ? NET::MaxVert : 0 ); - if(( state & NET::Max ) == NET::Max ) - ; // no resize - else if(( state & NET::MaxHoriz ) == NET::MaxHoriz ) + int state = 0; + if (size.width() > desk.width()) { + state = state | NET::MaxHoriz; + } + if (size.height() > desk.height()) { + state = state | NET::MaxVert; + } + + if (( state & NET::Max ) == NET::Max ) { + resize( desk.width(), desk.height()); + } + else if(( state & NET::MaxHoriz ) == NET::MaxHoriz ) { resize( width(), size.height()); - else if(( state & NET::MaxVert ) == NET::MaxVert ) + } + else if(( state & NET::MaxVert ) == NET::MaxVert ) { resize( size.width(), height()); - else + } + else { resize( size ); + } // TQWidget::showMaximized() is both insufficient and broken KWin::setState( winId(), state ); #else |