Version: HEAD (using KDE KDE 3.5.1) Installed from: Compiled From Sources OS: Linux PROBLEM: When Kst is started on a machine where it has never been run before the main application window is sized to be the smallest possible. STEPS TO REPRDOUCE: Start Kst on a machine where it has never been run before (or delete kst's configuration file) RESULTS: The application window is the smallest possible size. EXPECTED RESULTS: The application window should be maximised or some significant portion of the display.
The configuration is typically saved as ~/.kde/share/config/kstrc
SVN commit 633390 by arwalker: CCBUG:141612 a marginal improvement in the initial size of the app. the height is still the minimum value M +16 -0 kst.cpp M +2 -0 kst.h --- trunk/extragear/graphics/kst/src/libkstapp/kst.cpp #633389:633390 @@ -252,6 +252,22 @@ } +QSize KstApp::sizeHint() const +{ + QSize size(600, 480); + + QDesktopWidget *desktop = QApplication::desktop(); + if (desktop) { + QRect rect(desktop->availableGeometry()); + + size.setWidth(3*rect.width()/4); + size.setHeight(3*rect.height()/4); + } + + return size; +} + + void KstApp::initialize() { KstSettings::checkUpdates(); kConfigObject = new KConfig("kstdatarc", false, false); --- trunk/extragear/graphics/kst/src/libkstapp/kst.h #633389:633390 @@ -97,6 +97,8 @@ KstApp(QWidget* parent=0, const char* name=0); ~KstApp(); + virtual QSize sizeHint() const; + static KstApp* inst(); static void doubleCheckCleanup();
If the desktop is Xinerama then this will result in an application window that spans across multiple screens which is quite ugly. On 13-Feb-07, at 6:55 PM, Andrew Walker wrote: > SVN commit 633390 by arwalker: > > CCBUG:141612 a marginal improvement in the initial size of the app. > the height is still the minimum value > > M +16 -0 kst.cpp > M +2 -0 kst.h > > > --- trunk/extragear/graphics/kst/src/libkstapp/kst.cpp #633389:633390 > @@ -252,6 +252,22 @@ > } > > > +QSize KstApp::sizeHint() const > +{ > + QSize size(600, 480); > + > + QDesktopWidget *desktop = QApplication::desktop(); > + if (desktop) { > + QRect rect(desktop->availableGeometry()); > + > + size.setWidth(3*rect.width()/4); > + size.setHeight(3*rect.height()/4); > + } > + > + return size; > +} > + > + > void KstApp::initialize() { > KstSettings::checkUpdates(); > kConfigObject = new KConfig("kstdatarc", false, false); > --- trunk/extragear/graphics/kst/src/libkstapp/kst.h #633389:633390 > @@ -97,6 +97,8 @@ > KstApp(QWidget* parent=0, const char* name=0); > ~KstApp(); > > + virtual QSize sizeHint() const; > + > static KstApp* inst(); > static void doubleCheckCleanup(); > > _______________________________________________ > Kst mailing list > Kst@kde.org > https://mail.kde.org/mailman/listinfo/kst > -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/
Isn't the point of xinerama to display the desktop across multiple monitors. As a result any background image or maximized window will span multiple monitors. Given that a user is running xinerama I would have thought that having Kst span across multiple screens was exactly what they were after.
The desktop, not the window. No-one wants windows to span multiple screens. It's horribly unpleasant. Please see the KDE programming FAQ: http://developer.kde.org/documentation/other/developer-faq.html This should be corrected for the next release. -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/
use KGlobalSettings to determine desktop size to prevent problems with xinerama and multi-heads
Is this ready to close?
Its better than it was. I think the full solution would be to check if there's a size saved away in kstrc and if not set the initial geometry in main.cpp.
What's wrong with using the size hint? I'm assuming this isn't somehow overriding the KMainWindow auto-save settings, so it should be fine...
The size given by the size hint is not used as the final geometry. It seems to make the window grow in width, but no change in height.
That sounds like the old KMdi bug that has never been sorted out. -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/
What? KMdi doesn't have any bugs!
SVN commit 660418 by arwalker: BUG:141612 Set the default window size to something reasonable the first time kst is run. On subsequent runs the value from kstrc will be used. Fixed for 1.5 release. Also removed obsolete FIXMEs. M +5 -2 main.cpp --- branches/work/kst/1.5/kst/src/kst/main.cpp #660417:660418 @@ -24,6 +24,7 @@ #include <kaboutdata.h> #include <kcmdlineargs.h> #include "ksdebug.h" +#include <kglobalsettings.h> #include <kimageio.h> #include "dialoglauncher-gui.h" @@ -415,6 +416,8 @@ if (!print_and_exit) { app.setMainWidget(kst); + QRect rect = KGlobalSettings::desktopGeometry(kst); + kst->resize(5 * rect.width() / 6, 5 * rect.height() / 6); kst->show(); } @@ -542,7 +545,7 @@ if (yvector) { // make the curves color = KstColorSequence::next(vcurves,plot->backgroundColor()); - curve = new KstVCurve(KST::suggestCurveName(yvector->tag(), false), // FIXME: this was yvector->field(), is this right? + curve = new KstVCurve(KST::suggestCurveName(yvector->tag(), false), KstVectorPtr(xvector), KstVectorPtr(yvector), 0L, 0L, 0L, 0L, color); if (in.has_points) { @@ -667,7 +670,7 @@ KstHistogram::AutoBin(KstVectorPtr(yvector), &N, &max, &min); - hs = new KstHistogram(KST::suggestHistogramName(yvector->tag()), // FIXME: this was yvector->field(), is this right? + hs = new KstHistogram(KST::suggestHistogramName(yvector->tag()), KstVectorPtr(yvector), min, max, N, KST_HS_NUMBER); KstVCurvePtr vc = new KstVCurve(KST::suggestCurveName(hs->tag(), true), hs->vX(), hs->vY(),