summaryrefslogtreecommitdiffstats
path: root/tdeui/tdemainwindow.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-23 11:33:34 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-23 11:33:34 -0500
commit2d2661a554c5195069caf2d3eead729f52898a8d (patch)
treed79d43b5784380fb48be83978d03015cef5c07ef /tdeui/tdemainwindow.cpp
parentb1c819c3238e94960154915f1ae14131fdb25cf8 (diff)
downloadtdelibs-2d2661a554c5195069caf2d3eead729f52898a8d.tar.gz
tdelibs-2d2661a554c5195069caf2d3eead729f52898a8d.zip
Fix incomplete size restoration in TDEMainWindow class
This resolves Bug 1519 Clean up build warnings in KEditToolbar
Diffstat (limited to 'tdeui/tdemainwindow.cpp')
-rw-r--r--tdeui/tdemainwindow.cpp24
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