kdelibs/kdelibs-4.1.3-kde#172042-windowsize.patch
2008-10-15 12:26:02 +00:00

56 lines
1.7 KiB
Diff

Index: kdeui/widgets/kmainwindow_p.h
===================================================================
--- kdeui/widgets/kmainwindow_p.h (revision 871464)
+++ kdeui/widgets/kmainwindow_p.h (revision 871465)
@@ -44,6 +44,7 @@
bool settingsDirty:1;
bool autoSaveWindowSize:1;
bool care_about_geometry:1;
+ bool sizeApplied:1;
bool shuttingDown:1;
KConfigGroup autoSaveGroup;
QTimer* settingsTimer;
Index: kdeui/widgets/kmainwindow.cpp
===================================================================
--- kdeui/widgets/kmainwindow.cpp (revision 871464)
+++ kdeui/widgets/kmainwindow.cpp (revision 871465)
@@ -284,6 +284,8 @@
dockResizeListener = new DockResizeListener(_q);
letDirtySettings = true;
+
+ sizeApplied = false;
}
static bool endsWithHashNumber( const QString& s )
@@ -677,6 +679,8 @@
bool KMainWindow::readPropertiesInternal( KConfig *config, int number )
{
+ K_D(KMainWindow);
+
if ( number == 1 )
readGlobalProperties( config );
@@ -691,6 +695,8 @@
if ( cg.hasKey(QLatin1String("ObjectName" )) )
setObjectName( cg.readEntry("ObjectName").toLatin1()); // latin1 is right here
+ d->sizeApplied = false; // since we are changing config file, reload the size of the window
+ // if necessary. Do it before the call to applyMainWindowSettings.
applyMainWindowSettings(cg); // Menubar, statusbar and toolbar settings.
s.setNum(number);
@@ -708,7 +714,10 @@
d->letDirtySettings = false;
- restoreWindowSize(cg);
+ if (!d->sizeApplied) {
+ restoreWindowSize(cg);
+ d->sizeApplied = true;
+ }
QStatusBar* sb = internalStatusBar(this);
if (sb) {