summaryrefslogtreecommitdiffstats
path: root/kdeui/kmainwindow.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-23 11:33:34 -0500
committerSlávek Banko <slavek.banko@axis.cz>2015-12-23 02:22:26 +0100
commitc1d2654b775fbd72cfc78b0c1420cfdee62ead47 (patch)
treeb757f3894af94bdb5220cde98e605476959f75b8 /kdeui/kmainwindow.cpp
parent7cd5f2324d0ed56357f2df73a8f6cb359bb5b02e (diff)
downloadtdelibs-c1d2654b775fbd72cfc78b0c1420cfdee62ead47.tar.gz
tdelibs-c1d2654b775fbd72cfc78b0c1420cfdee62ead47.zip
Fix incomplete size restoration in TDEMainWindow class
This resolves Bug 1519 Clean up build warnings in KEditToolbar (cherry picked from commit 2d2661a554c5195069caf2d3eead729f52898a8d)
Diffstat (limited to 'kdeui/kmainwindow.cpp')
-rw-r--r--kdeui/kmainwindow.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/kdeui/kmainwindow.cpp b/kdeui/kmainwindow.cpp
index 397c2479c..92d90ac4b 100644
--- a/kdeui/kmainwindow.cpp
+++ b/kdeui/kmainwindow.cpp
@@ -955,16 +955,26 @@ void KMainWindow::restoreWindowSize( KConfig * 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